Email 'from' is wrong person

I have a bot which, when triggered, runs a script that generates a draft email. It works fine except that the email so produced is always generated as from me, not from the user. When the user does something that triggers the script, an email is generated in my Drafts folder, not theirs.

Any idea why?

That’s because the script is ran by the app owner.

You can see it there:

1 Like

Thanks. I hadn’t noticed that. So how do I make it so that the script is run by the user?

Hi @Revett

This is far from my skills.

I think you could have a better chance at looking on a community dedicated to Apps Script.

Many thanks anyway! I am changing the script so that instead of sending an email, it creates an email template. Then I have added a second task to the bot, consisting of sending an email using the template I just created. This should work as in this case the email is sent by the user, not me, the script’s originator. Your reply to my post set me on the right course, so thanks again.