gmail-addons

get current thread id in gmail using google app script

荒凉一梦 提交于 2021-01-29 10:42:05
问题 I am building a Gmail Add-On. I want to get the thread Id of current open email thread using Google Apps Script. I tried to figure out in Google Developers documentation for GmailApp . But nothing found relevant. 回答1: You can retrieve messageId of the current message from e.messageMetadata.messageId of buildAddOn(e) . Using this, you can retrieve threadId as follows. var threadId = GmailApp.getMessageById(messageId).getThread().getId(); References : getMessageById() getThread() If this was

Can't serve HTML on the Google Apps Script callback page in a GMail add-on

☆樱花仙子☆ 提交于 2021-01-28 18:12:05
问题 I am working on a GMail add-on that connects to a third-party service through OAuth2. To obtain the authorization code the following redirect URI is used: https://script.google.com/macros/d/[SCRIPT_ID]/usercallback . Here's a snippet that triggers authorization: var stateToken = ScriptApp.newStateToken() .withMethod( "authCallback" ) .withTimeout( 120 ) .createToken(); var authUrl = _authBaseUrl + "&client_id=" + encodeURIComponent( _clientId ) + "&redirect_uri=" + encodeURIComponent(

Can't serve HTML on the Google Apps Script callback page in a GMail add-on

混江龙づ霸主 提交于 2021-01-28 18:03:28
问题 I am working on a GMail add-on that connects to a third-party service through OAuth2. To obtain the authorization code the following redirect URI is used: https://script.google.com/macros/d/[SCRIPT_ID]/usercallback . Here's a snippet that triggers authorization: var stateToken = ScriptApp.newStateToken() .withMethod( "authCallback" ) .withTimeout( 120 ) .createToken(); var authUrl = _authBaseUrl + "&client_id=" + encodeURIComponent( _clientId ) + "&redirect_uri=" + encodeURIComponent(

Gmail Add-On: Oauth not being triggered

大憨熊 提交于 2021-01-27 04:19:32
问题 In the code below, 'Test' button triggers a function which calls an external endpoint to load data. However, nothing happens when the button is clicked and I get a 400 error in the console area saying Invalid Argument . Code.gs function buildAddOn(e) { // Create a section for that contains all user Labels. var section = CardService.newCardSection() var action = CardService.newAction() .setFunctionName("testCall"); var button = CardService.newTextButton().setText('Test').setOnClickAction

Google app script,gmail addon remove user properties while uninstall addon [duplicate]

我们两清 提交于 2020-12-27 06:32:44
问题 This question already has answers here : Handling persistent user-specific values in Gmail Add-ons (2 answers) Closed 3 months ago . I have create simple gmail addon using google script,in that i have struggle here, i have used UserProperties,the problem is, i have store some user level script values.while uninstall addon,we need remove UserProperties Thanks in advance 回答1: I do not think there is an uninstall event. According to the docs it is not listed in the Add-on lifecycle or the list

Google app script,gmail addon remove user properties while uninstall addon [duplicate]

蹲街弑〆低调 提交于 2020-12-27 06:32:22
问题 This question already has answers here : Handling persistent user-specific values in Gmail Add-ons (2 answers) Closed 3 months ago . I have create simple gmail addon using google script,in that i have struggle here, i have used UserProperties,the problem is, i have store some user level script values.while uninstall addon,we need remove UserProperties Thanks in advance 回答1: I do not think there is an uninstall event. According to the docs it is not listed in the Add-on lifecycle or the list

Keep getting “Deployment Id is not associated with current project.” when publishing

只愿长相守 提交于 2020-12-15 06:00:48
问题 I'm trying to publish a Gmail Addon. I'm following guide here: https://developers.google.com/gmail/add-ons/how-tos/publish but each time I click save in " Apps Marketplace SDK " configuration page I get the error in the title: "Deployment Id is not associated with current project." That's nonsense, since the associated project has been created directly with an action triggered from https://script.google.com I have even tried to manually create a new project, and to associate the script to the

Creating a select (dropdown) input with a dynamic list of options in a gmail addon

落爺英雄遲暮 提交于 2020-12-13 04:39:05
问题 The Google App Script SelectionInput docs show selection inputs with a static list of options. Trying to create a dynamic options list like below: var items = [...]; var selectWidget = CardService.newSelectionInput() .setType(CardService.SelectionInputType.DROPDOWN) .setTitle("Select an item") .setFieldName("item"); items.forEach(function (item) { selectWidget.addItem(item, item, false); }); results in a runtime error: Object does not have property - /​Card/​sections[0]/​widgets[1]/​selection

Html email responsive issue When copying to gmail

眉间皱痕 提交于 2020-07-31 06:08:10
问题 I have a html email template that i need to send via gmail. So what i did 2,3 methods . Method 1 : copy paste the email from browser to gmail Method 2: Using Inspect element paste the code Method 3 : Using chrome extension Every methods desktop view is ok . But in mobile view there are issues Please see the html code https://drive.google.com/file/d/1ftM9saAT6ZhvSPNf81uRgBQm3J3KbxwP/view?usp=sharing Please help to solve this But when i use puhmail https://putsmail.com/tests/new and paste my