How to Get the Permanent URL of an Email Message in Gmail with Apps Script
All email messages in your Gmail inbox have a permanent web address and you can add this URL to your bookmarks to quickly access that message in the future. You can save these message links in your task list or your meeting notes as they provide important context to the conversation. The URL of any email message is Gmail follows a standard format: https://mail.google.com/mail/u/<<UserId>>/#label/<<Label>>/<<UniqueId>> The UserId is the sequential ID of the currently-logged Gmail account (default is 0 ). The Label is the name of the Gmail label that the message is in (or use all ). The UniqueId is a unique ID that Gmail assigns to each message. The key here is the UniqueId that is internally assigned by Gmail. Get Gmail Message Links with Google Apps Script When you send an email with Google Apps Script, the Gmail API returns a unique ID that you can use to determine the URL of the email message in your sent items. Here’s a simple pr...