How to Rename Gmail Emails and File Attachments in Google Drive

Published in: Download Gmail to Google Drive

The premium version of Save Emails offers an easy option to rename file attachments and email messages when the are downloaded to your Google Drive for archiving.

For instance, if the attachment name is “resume.pdf”, you can write a rule that will rename that attachment to, say, “Jan-20-2017 Angus McDonald resume.pdf” where Jan-20 is the date of the email message and Angus is the name of the sender.

Open your Google Spreadsheet, go to Addons > Save Emails > Create Rule (or modify an existing rule) and go to the download section as shown below:


Similar to Mail Merge, you use variable name enclosed in double curly braces.

For instance, if you need to include the name of the sender and the message’s subject in the saved email, you set the File name as {{Subject}} {{Sender}}. Email messages are downloaded in PDF format and the .pdf extension will be added to the name automatically.

For attachments, you can use {{AttachmentName}} (no spaces) to have the saved file name exactly as the original file.

Or use the following format to set the name depending on the date of the message.

{{Year}}-{{Month}} {{Sender}}.{{AttachmentType}}

Here’s a complete list of variables that you can use while setting the name of emails and file attachments with save emails.

VariableDescription / Example
{{AttachmentName}}Original file name (e.g. resume.pdf)
{{AttachmentBase}}Base name of the file (e.g., resume)
{{AttachmentType}}File extension or format (e.g., pdf)
{{MessageId}}Email Message Id
{{ThreadId}}Email Thread Id
{{Date}} (format can be customized)Message Date (e.g., 26-Feb-2017)
{{Day}}26 (dd)
{{DayName}}Wed (EEE)
{{DayNameFull}}Wednesday (EEEEE)
{{Week}}Week Number (ww)
{{Month}}Feb (MMM)
{{MonthNumber}}02 (MM)
{{MonthName}}February (MMMMM)
{{Year}}2017 (YYYY)
{{Sender}}Sender’s Name (from the From field)
{{Recipient}}Recipients Name (from the To field)
{{Subject}}Email Subject
Published in: Download Gmail to Google Drive

Looking for something? Find here!

Meet the Author

Web Geek, Tech Columnist
Amit Agarwal

Amit Agarwal is a Google Developer Expert in GSuite and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. Read more on Lifehacker and YourStory

Get in touch