Apps Script - Choose account

I am using the Apps Script pack, which works great to trigger emails from Gmail (with more functionality than in the regular gmail pack)!

However, I would like to trigger emails from different accounts (e.g. sometimes from help@ and sometimes from sales@).

I can add multiple accounts under the Apps Script settings (under Shared Account). However, I do not have the opportunity in the configuration of my action to set the “Mode” to shared and pick what account I want to use.

Example
When using the regular Gmail pack, I can select “Mode” and afterwards choose between all the shared accounts.

In the App Script pack, there is no such option:

@Eric_Koleda any input on how I can achieve this? Or would you consider adding this functionality into your pack?

Thanks a lot for any input!

I don’t think this is possible because a single apps script is authorized at the app script level by the user.

Therefore, if you want to send an email with a single button but use a different account depending on the user, you’d need two different deployed apps scripts and to store both of those urls on your coda document.

Alternatively, if those emails (help, support, etc) aren’t actually separate users but aliases or groups, I believe you can set a “from” parameter or something similar on your apps script code and then conditionally have it send from those different aliases.

Could be wrong though! Maybe there’s a way to make a single apps script trigger off a different authenticated user but to my knowledge you can’t.

Not a limitation of the pack - limitation of apps script.

1 Like

+1 to what @Scott_Collier-Weir said. The way the Trigger Web App action works is that it does use your credentials in Coda at all, but calls a public web app with the credentials set there. The best route would be to do what Scott recommends, and setup your Gmail account to be able to send from multiple “From” addresses and then use that option of GmailApp to change the from address.

2 Likes

Thanks a lot, @erik_koleda and @Scott_Collier-Weir - much appreciated.

Now set up and everything works perfectly! Thanks!

2 Likes