
You can now easily send a mass email or mail merge in Gmail with personalized attachment files.
Why would you ever need to do this? Let’s say you run a small business that needs to send PDF invoices to your customers once a month. Your billing software generates the PDF invoices, one for each of your 100 customers. Now you need to send the right invoice to the right customer, and you don’t want to manually compose and send 100 individual emails, having to attach the right PDF to each email.
Now you can automate all of this. Here’s a 2-minute video demo:
What tools will you need to email personalized files?
- All of your attachment files, ready to send
- A Google Sheet that lists the email addresses in one column and the file names in the other
- A place to host the files, in a place like Google Drive, Amazon S3, Dropbox, or your own web server
- A Gmail or G Suite account
- GMass installed and connected
Host your files somewhere
Your files can either be in your Google Drive or somewhere publicly accessible on the web, like your own web server, a public Dropbox folder, or a public AWS S3 bucket.
If you’re going to host your file attachments in your Google Drive, our software needs permission to access your Google Drive. It’s the one step you have to take in advance of sending any personalized attachments.
You must give GMass read-only permissions to your Google Drive! By default, GMass doesn’t have permissions for this when you sign up for an account.
——————-
To allow GMass to download files from your Google Drive:
>>>>>>> FOLLOW THIS LINK <<<<<<<<
——————-
and log in with the same account that you’re using to send your mass email.
Also, note that the files don’t all have to be in the same folder; they can be spread across multiple folders along as they’re in one single Google Drive account. Lastly, if you use Google Drive, be sure that the “Convert uploaded files…” setting is UNCHECKED:
(click Settings gear first at top-right, then uncheck that box, then click DONE)
If you don’t uncheck this box, then certain file types, like .txt files won’t remain as txt files after you upload them; they’ll get converted to Google Docs and won’t be “attachable” to your emails.
Set up your spreadsheet
First, set up your Google Sheet. Make sure your column headings are in the first row, and at a minimum you’ll need two columns, one for the email address, and one for the file to be attached. You can have other columns too, like FirstName, LastName, Company, and anything else you want to use to personalize your mail merge. Here’s what your spreadsheet should look like:
The column containing the files can be named anything as long as it starts with “attachment.” Any of the following are valid column names:
- Attachment
- Attachment1
- AttachmentFile
- attachment10
It’s not case sensitive either. If your files are hosted in Google Drive, then the column should contain just the file name. If your files are hosted somewhere on the web, then the column should contain the full URL to the file. Here’s what your spreadsheet might look like if you’re hosting your files on your own web server.
If you’re a spreadsheet wizard, feel free to use formulas for the attachment column as well. For example, if you’re sending monthly statements to your customers, and your billing software generates the monthly statements in the format of [CustomerNumber].pdf, and CustomerNumber is one of the column in your spreadsheet, you can set the attachment column to “=A1” + .pdf.
Finally, if you have blank cells in an “attachment” column, then it’s assumed that those recipients don’t have corresponding files, and the emails will be sent without attaching any file.
Connect to your spreadsheet, compose, and send
If you’ve performed a mail merge with GMass before, the next step should be familiar. Click the Sheets connector button, choose your spreadsheet and worksheet, hit the “Connect” button, and a Gmail Compose will open. Type your message, and hit the GMass button. You don’t need to attach any files to this message. GMass will automatically detect the column in your spreadsheet containing the files to be attached and attach them to the individual emails.
The only reason you would attach a file directly to the Gmail Compose window is if you also want a separate attachment to go to all recipients. In that case, any files you attach to the Draft will be sent to all recipients, and additionally, any personalized attachments set in the spreadsheet will also be sent.
For example, let’s say you publish a PDF newsletter monthly that you also want to send to everyone along with their personalized invoices. Then, you would attach the PDF newsletter to the Gmail Compose window, and after clicking GMass, each email would get sent with the newsletter PDF and the personalized invoice PDF.
Need to send more than one personalized attachment?
Do you need to send more than one personalized attachment per recipient? For example, if every month, you send your customers an invoice and an account summary, and they are two different PDFs, then you can have TWO columns in your spreadsheet, for example:
- Attachment1
- Attachment2
GMass will notice this, and send both personalized files to each recipient.
Automate this to send every day, week, or month
You can set your campaign and spreadsheet up once, and then let the emails send on autopilot every day, week, or month, based on your business’ needs. Let’s say you want your email with attachments to send on the first of every month. Just schedule your initial email to send on the first of the month, and then set it to repeat MONTHLY.
Now, on the first of every month, GMass will automatically read your spreadsheet, retrieve the files, and send the emails with their corresponding attachment. All you need to do before the first of each month is get new files in place, either to your Google Drive, or wherever you’re hosting them.
Error handling for missing files or permissions
If GMass can’t retrieve the file for a particular email address, that recipient will be skipped over and you’ll get a report at the end of the campaign of all recipients that were skipped over. If you intentionally don’t want certain recipients to receive any attachments with their emails, just make those cells blank under the “attachment” column — that way they will still receive the email but without anything attached.
If you’re hosting your files on Google Drive, but GMass doesn’t have permission to read from your Google Drive, then your campaign will error out with this error:
Insufficient Permission: Request had insufficient authentication scopes. [403]
Errors [
Message[Insufficient Permission: Request had insufficient authentication scopes.] Location[ – ] Reason[insufficientPermissions
]
GMass didn’t have sufficient permissions to your Gmail account to do what you wanted. If you were trying to send personalized attachments, re-connect your Gmail account and then click the RESTART link.
Using Dropbox to store your files
If you want to use Dropbox to store the files you want attached to your emails, then you’ll have to do some manual work — you’ll have to create public URLs for each and every single file you want to attach, even if all the files are in the same Dropbox folder. While Dropbox makes it easy to get a public link to a folder, and even a public link to a file, Dropbox does not make it easy to generate public links for say, 100 files, without going through the link creation process manually for each of the hundred links.
To generate a public link to a file, just right-click the file and choose “Copy Dropbox Link,” and then place that URL in the appropriate Google Sheet column.
But again, you will have to repeat that process for every single file, because there’s no pattern that you can follow to determine the links yourself. For example, if you have two files in Dropbox, doc1.pdf and doc2.pdf, and you generate public URLs to them, they will look like this:
https://www.dropbox.com/s/bz2536zash23znd/doc1.pdf?dl=0 https://www.dropbox.com/s/kjdjf91w5xuip6n/doc2.pdf?dl=0
Now let’s say you have 100 files for which you need to generate public links. While you can see the left portion of the URL includes “dropbox.com,” as expected, and the right portion includes the file name, as expected, there’s a unique identifier string inserted in the middle that prevents you from generating these URLs on your own for easy copying and pasting into a Google Sheet.
If you do go through the process of manually generating the Dropbox link for each file, then your Google Sheet will look like this:
Using Amazon S3 to store your files
Using S3 is a much more convenient option than Dropbox to store files for the purpose of personalized attachments, because S3 makes it easy to determine the public URL for any file. By default, an S3 bucket isn’t public, so make sure that if you create a bucket for the purpose of attaching files to emails, you make your bucket public. You must UNCHECK the “Block all public access” box and then CHECK the acknowledgement box:
Then, when you upload your files to a bucket, make sure you choose “Grant public read access…” to the objects:
After your files are uploaded, S3 provides you with the public URL for each file, and it’s simply the DNS name you chose for your bucket in combination with the filename:
So in this case, my first two files will have the URL:
https://emailattachments.s3-us-west-2.amazonaws.com/doc1.pdf https://emailattachments.s3-us-west-2.amazonaws.com/doc2.pdf
Note that these URLs don’t actually work, so don’t try visiting them! But, any files I upload to this bucket will have a URL in the same format, which means my Google Sheet would look like this:
Other tips and tricks
What else can you do to make your emails with personalized files even better?
- Perhaps you don’t want to attach actual files to your emails, but you instead want to link to a unique file per email address. Here’s how you can send a campaign with personalized links.
- If you need a response from your recipients, consider setting reply-based follow-ups to send automatically.
- If you need to send more emails than your Gmail account allows, connect an SMTP service to your account or apply to use our SendGrid account. For example, if you need to send 10,000 customers a personalized PDF every month, you’ll want to integrate an external SMTP service so that Gmail doesn’t prematurely bounce your emails.
- Make sure your emails with attachments make it to the Inbox with our Spam Solver.
- If you ended up here looking for much simpler personalization options, like how to make each email start with “Dear {FirstName}”, see our complete guide to personalization.
Hi there! Thank you so much for adding this new feature! Quick question- does this support attachments with spaces in the file name? Or could that possibly result in errors?
Hi Jillian,
Since the attachment link is based on the Google Drive link, the filename itself doesn’t contain any spaces as it’s assigned an attachment ID which is what is used for the links.
All respect for this wonderful service.
Thank you for the kind words Osama!
Clarification: Does the file need the .pdf added to the end of its name? Or can they just be Name1, Name2, etc?
Hi Ged,
You would also need to add the file type at the end of your file name.
Hi,
I have followed the steps, from a pdf in my google drive I clicked ‘get sharable link’ and copied the link into the attachments column on the spreadsheet. However, when I send this what is received is a file named ‘view’ which can only be opened in a brower, so a pdf is not received. Can you help?
thanks,
What are the limits for a free version ?
Hi Asha,
The free version is limited to sending a maximum of 50 emails per rolling 24 hours. If you’d like to lift this limit, please check out our paid subscriptions (gmass.co/pricing)
Do you have to put the complete file name or can you put the end individual part?
Hi Gemma,
Yes, you would need to put the complete filename.
Thanks for this app. Question regarding attachments that are in a subdirectory on the Google Drive. How do you identify those files in the spreadsheet to link with the email? What is the syntax for that field?
Hello! Is there a way of referencing the file name on a Google Shared Drive? I couldn’t do it when the file was on a Shared Drive so I had to move all the files to MyDrive.
I am waiting on a response for this as well. We do not store any client files in “My Drive”, all of our client files are located in a Shared Drive that our staff has access to (with the correct permissions set up). PLEASE ADVISE. If this is not a feature, it needs to be ASAP.
Gmass is amazing! Loving this software. Quick question; if I add attachements to a google sheet mail merge to be sent with my original email will those same attachments be attached to the follow-up emails as well?
Hi,
Facing the same problem like people before.I have followed the steps, from a pdf in my google drive I clicked ‘get sharable link’ and copied the link into the attachments column on the spreadsheet. However, when I send this what is received is a file named ‘view’ which can only be opened in a brower, so a pdf is not received. Can you help?
thanks
As long as the file exists in your Google Drive, you won’t need to use the shareable link – instead, just add the filename in your attachment column as seen in this image from the post above: https://blogcdn.gmass.co/blog/wp-content/uploads/2020/05/001-personalized-attachment-spreadsheet-175kb-768×819.png
Does the software have decision capabilities, (if, case, etc.), specially for the free version?
Hi Vrikson,
Unfortunately, no GMass does not have an if-this-then-that capability.
Hi, I am trying to use the “Attachment” option for a test email – however, I keep getting:
“Error: Your test email to transcripts@rnsoffice.com was NOT sent. It might be on your account’s Unsubscribe or Bounce list. There was an error:
transcripts@rnsoffice.com: Gmass-UnableToFindAttachment.jpg (Unable to find the specified file.)”
How can I resolve this? The file and the email both appear to be valid…
Thanks in advance!
Hi Jagannath,
Please try sending to a different email address as it appears you’re sending to and from the same email account.
Hi,
I can’t seem to get past the connect account issue. I keep getting the following error: Object reference not set to an instance of an object.
I really don’t know what to do to fix it.
I am having the same exact issue. Cannot connect my account to Gmass. A NullReferenceException, really? 🙁
Hi, I want to send individualized PDFs and am using the =A1 + “.pdf” way, but it’s not pulling the attachments from google drive… is that because they’re in a folder or where should I place them in order for the sheet to pull them as shown in the example where attachments are named “1001.pdf”>