Skip to content

I can't authorize sending emails #121

Open
@kurokirasama

Description

@kurokirasama

Hey, I tried adding this:

function sendLog(newvideos){
  var recipient = Session.getActiveUser().getEmail();
  var subject = 'YT2Discord Log: ' + newvideos + 'new videos.';
  var body = Logger.getLog();
  MailApp.sendEmail(recipient, subject, body);  
}

When running a script, I'm usually asked for permissions, but here I'm not, and therefore getting this error message:

Exception: You do not have permission to call Session.getActiveUser. Required permissions: https://www.googleapis.com/auth/userinfo.email
sendLog	@ sendLog.gs:2
updatePlaylists	@ Code.gs:200

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions