LoginSignup
2
3

More than 3 years have passed since last update.

【GAS】Gmailのメールのリンクの取得

Posted at

メールのリンクはhttps://mail.google.com/mail/u/0/#all/ + そのメールのID

サンプル

function test() {
  const threads = GmailApp.search('test');
  const messages = GmailApp.getMessagesForThreads(threads);
  const result = messages.map(function(msg) {
    return getLinkOfEmail(msg[0]);
  });

  Logger.log(result)
}

function getLinkOfEmail(email) {
    return 'https://mail.google.com/mail/u/0/#all/' + email.getId();
}

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3