Search code examples
google-apps-scriptgmail-apigmail-addons

How to get current Users Email ID in GMAIL ADDONS


I am learning to make gmail addons. But I am stuck at a point on how to access email address value of user who using addons.

After Reading I get that I will need this permission https://www.googleapis.com/auth/userinfo.email

But how to actually get email address when user opens addon in Gmail

Please can anybody help me on this


Solution

  • This seems to work:

    var emailAddress = Session.getEffectiveUser().getEmail();