Skip to main content

How to Rename Email Attachments from Gmail in Google Drive

The Save Emails add-on offers an easy option to rename file attachments and email messages when they are downloaded to your Google Drive or Shared Drive.

For instance, if the attachment name in the Gmail message is resume.pdf, you can configure the settings in such a way that will rename and save the attachment as, say, Jan-20-2024 Angus McDonald resume.pdf where Jan-20 is the date of the email message and Angus McDonald is the name of the email sender.

Open your Google Spreadsheet, go to Extensions > Save Emails and Attachments > Create Workflow (or modify an existing workflow) and go to the Configure section as shown below.

Rename Gmail Attachments

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 }} by selecting those markers from the drop-down panel.

For attachments, you can use markers like {{ Attachment Base }} {{ Date }}.{{ Attachment Type }} to add the date on which the attachment was received into the original attachment file name.

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

{{ Message ID }}Unique ID of the Gmail Message
{{ Thread ID }}Unique id of the thread that contains the message
{{ Attachment Name }}Original attachment file name (e.g. resume.pdf)
{{ Attachment Base }}Base name of the attachment file (e.g., resume)
{{ Attachment Type }}File extension or format of the attachment (e.g., pdf)
{{ Subject }}Subject line of the email message
{{ Recipient }}The email address of the message recipient
{{ Sender Name }}Name of the email sender (take from the FROM header)
{{ Sender Email }}The email address of the message sender
{{ Sender Domain }}The domain of the email address of the message sender
{{ Date }}Date in MM-DD-YY format. E.g., 11-30-2024
{{ Date UK }}Date in DD/MM/YY format. E.g., 30/11/2024
{{ Time }}Current time in h:mm a format. E.g., 10:38 pm
{{ Long Date }}Full date. E.g., Fri, Dec 2, 2022
{{ Day }}Current day. E.g., 02 for 2nd of the month
{{ Day Name }}Short name of the current day. E.g., Fri for Friday
{{ Day Name Full }}Full name of the current day. E.g., Thursday
{{ Month }}Short name for current month. E.g., Nov for November
{{ Month Number }}Month in number format. E.g., 12 for December
{{ Month Name }}Full name of the current month E.g., December
{{ Year }}Current year. E.g., 2022
{{ Year YY }}Current year in short format. E.g., 22 for 2022
{{ Hour }}Current hour in 12-hour format. E.g., 10 for 10 AM
{{ Hour 24 }}Current hour in 24-hour format. E.g., 22 for 10 PM
{{ Minute }}Current minute. E.g., 38 for 10:38 PM
{{ Second }}Current second. E.g., 22 for 10:38:22 PM

Important: All dates are calculated based on the timezone of the user who is managing the workflow. The app will automatically detect the timezone of the user's browser and use it to calculate the values of date and time markers.