How to Attach Files with the Embed File Marker
The Embed File marker attaches a Google Drive file to your email. You type the marker in the message. The marker leaves no text in the email, and the file arrives as a regular attachment.
Use the marker when the attachment belongs to the email, not to the sheet:
- A file for everyone, like a price list, when you don’t use a Gmail draft.
- Two campaigns on one sheet. The welcome email attaches the handbook, and the invoice email attaches the invoice. Neither campaign changes the sheet.
- More than one file column, like Invoice and Contract, where each campaign picks the column it needs.
- Files named after a column, like
INV-1042.pdf, without writing a formula.
Attach an Invoice and a Price List to Each Email
Section titled “Attach an Invoice and a Price List to Each Email”Maya at Willow Lane Studio sends her monthly invoices. Each client gets their own invoice, and everyone gets next year’s price list.
| First Name | Email Address | Invoice Number | Invoice |
|---|---|---|---|
| Angus | angus@example.com |
INV-1042 | INV-1042 Fernhill Bakery.pdf |
| Daniel | daniel.okafor@example.net |
INV-1043 | INV-1043 Okafor Architects.pdf |
| Sofia | sofia.marquez@example.org |
INV-1044 |
The Invoice cells hold file chips. Sofia has nothing to pay this month, so her cell is empty.
-
In your sheet, add a column titled Invoice. In each row, type
@and a few letters of the file name, then pick the file. Sheets adds a file chip. A pasted Drive link works too. -
Go to Extensions > Mail Merge with Attachments > Open Mail Merge, open your campaign and move to the Template step.
-
In the Message box, type one
Embed Filemarker for each file, each on a line of its own. The end of the message is a good place.Hi {{First Name}},Your invoice {{Invoice Number}} is attached, along with our price list for 2027.Maya{{Embed File, {{Invoice}}}}{{Embed File, Price List 2027.pdf}} -
Click Send Test Email and send the email to yourself. Open each attachment to check it.
-
Go to the Save & Run step and click Send Emails.
Google Sheet
| First Name | File Attachments |
|---|---|
| Angus | INV-1042 Fernhill Bakery.pdf |
| Daniel | INV-1043 Okafor Architects.pdf |
| Sofia |
Emails sent
- To: AnguspdfINV-1042 Fernhill Bakery.pdfpdfPrice List 2027.pdf
- To: DanielpdfINV-1043 Okafor Architects.pdfpdfPrice List 2027.pdf
- To: SofiapdfPrice List 2027.pdf
Mail Merge removes the markers from the message, so nobody sees them. Sofia’s Invoice cell is empty, so she gets the price list only.
Ways to Name the File
Section titled “Ways to Name the File”{{Embed File, file}}| You want | Marker | What is attached |
|---|---|---|
| A file for everyone, by name | {{Embed File, Price List 2027.pdf}} |
The file with that name in your Drive |
| A file for everyone, by Drive link | {{Embed File, https://drive.google.com/file/d/1AbC…789/view}} |
That exact file |
| A file inside a folder | {{Embed File, Willow Lane/Price Lists/Price List 2027.pdf}} |
The file at that folder path |
| A file name with a comma | {{Embed File, "Terms, 2027.pdf"}} |
Terms, 2027.pdf. The quotes keep the comma. |
| A Google Doc, Sheet or Slides file | {{Embed File, Statement of Work}} |
A PDF of the file, named Statement of Work.pdf |
| Each person’s file from a column | {{Embed File, {{Invoice}}}} |
The file linked in that row’s Invoice cell |
| Each person’s file by a naming pattern | {{Embed File, Invoices/{{Invoice Number}}.pdf}} |
INV-1042.pdf from the Invoices folder for Angus |
Use one marker for each file. Typed text is always one file, even when it has a comma inside quotes.
Attach the Same File to Everyone
Section titled “Attach the Same File to Everyone”Type the file’s name exactly as it appears in Google Drive, including the extension:
{{Embed File, Directions to the studio.pdf}}{{Embed File, Brand workbook.pdf}}If several files in your Drive share that name, add the folder path in front, or paste the file’s Drive link in place of the name. Use a Drive link for a file in a shared drive, because Mail Merge looks up names and folder paths in My Drive and in files shared with you.
To get the link, right-click the file in Google Drive, choose Share and then Copy link. You don’t need to change who the file is shared with. Mail Merge reads the file with your account and attaches a copy.
Attach a Different File from a Column
Section titled “Attach a Different File from a Column”Put each person’s file in a column and point the marker at the column:
{{Embed File, {{Invoice}}}}The cell must hold a Google Drive link. These all count:
- A file chip, which you add by typing
@and the file name - A pasted Drive link, like
https://drive.google.com/file/d/…/view - Text with a Drive link on it, made with Insert > Link or
HYPERLINK - Several Drive links in one cell, separated by commas or on separate lines. Mail Merge attaches all of them.
If a row’s cell is empty, Mail Merge still sends the email without a file from that marker.
Use two file columns
Section titled “Use two file columns”A sheet can have as many file columns as you need. Say Maya’s sheet also has a Contract column for new clients. Her welcome campaign attaches the contract, and her invoice campaign attaches the invoice:
| Campaign | Marker in the message |
|---|---|
| Welcome email | {{Embed File, {{Contract}}}} |
| Monthly invoice | {{Embed File, {{Invoice}}}} |
With the File Attachments column, both campaigns would attach the same files.
Send back a file from a Google Form
Section titled “Send back a file from a Google Form”When a Google Form has a file upload question, each answer in the response sheet is a Drive link to the uploaded file. An Embed File marker can attach the uploaded file.
Say staff submit expense claims with a form that has a Receipt upload question and a Manager Email question. Choose Manager Email under Send to, and write:
{{First Name}} has claimed {{Amount}} for {{Purpose}}. The receipt is attached.
{{Embed File, {{Receipt}}}}Each manager gets the claim with the staff member’s receipt attached.
Attach Files by a Naming Pattern
Section titled “Attach Files by a Naming Pattern”When your files are named after a column, type the folder and build the file name with a merge field:
{{Embed File, Invoices/{{Invoice Number}}.pdf}}For Angus, Mail Merge looks for INV-1042.pdf in the Invoices folder. You don’t need a formula or a file column.
| Your files | Marker |
|---|---|
| Report cards named by student ID, in nested folders | {{Embed File, Report Cards/Class 8B/{{Student ID}}.pdf}} |
| Payslips named by employee ID and month | {{Embed File, Payslips/{{Month}}/{{Employee ID}}.pdf}} |
| Certificates named by the person | {{Embed File, Certificates/{{First Name}} {{Last Name}}.pdf}} |
| Tickets with a prefix | {{Embed File, Tickets/Ticket-{{Seat}}.pdf}} |
The value from the row can only be part of the file name. If the value holds a slash, like 2026/INV-1042, Mail Merge doesn’t send the email for that row.
Why a Column Must Hold a Drive Link
Section titled “Why a Column Must Hold a Drive Link”A Drive link points to one exact file, and you can open the link from the sheet to check the file. A name typed in the marker is your own choice. Mail Merge sends only files you chose, so the rule is:
| Where the file is named | Drive link or chip | File name, folder path or file ID |
|---|---|---|
Typed in the marker, like Price List 2027.pdf |
Works | Works |
In a column, like {{Invoice}} |
Works | Mail Merge doesn’t send that row’s email |
Two things the rule doesn’t cover:
- A pattern still uses a value from the row. In
Invoices/{{Invoice Number}}.pdf, the row picks the file inside the folder you typed. Use patterns with columns you fill in yourself, not with answers from a form. - The File Attachments column still accepts names and paths. Don’t let other people fill in that column. See type file names or folder paths.
Embed File or the File Attachments Column?
Section titled “Embed File or the File Attachments Column?”You can use both in the same campaign. If a file is named in both places, Mail Merge attaches it once.
Embed File marker |
File Attachments column | |
|---|---|---|
| Where you set it up | In the message | In the sheet |
| A file for everyone | One marker | The same link in every row |
| Different files for different campaigns | Yes, each template has its own markers | No, every campaign on the sheet attaches the column |
| File names and folder paths in a column | No, Drive links and chips only | Yes |
| Files named after a column | A pattern in the marker | A formula in the column |
| Pick files from a dropdown or the file picker | No | Yes |
Things to Know
Section titled “Things to Know”- Mail Merge attaches Google Docs, Sheets and Slides as PDFs, and other files as they are.
- Each email can carry up to 25 MB of attachments combined, counting every marker, the File Attachments column and files on a Gmail draft. See size and access limits.
- The Google account that runs the merge must be able to open the file. Recipients get a copy and don’t need access in Drive.
- Mail Merge picks up the file when the email goes out. With a scheduled email, recipients get the latest version.
- The marker works in every editor, including plain text, but not in the subject.
- A drafts campaign attaches the files to each draft, so you can check them before you send anything.
Troubleshooting
Section titled “Troubleshooting”When Mail Merge can’t attach a file, it doesn’t send the email for that row. It writes the reason in the row’s Mail Merge Status cell. The other emails still go out. Fix the problem, clear that row’s status cell and run the campaign again.
Invalid attachment - Embed File needs a Google Drive link in the column
Section titled “Invalid attachment - Embed File needs a Google Drive link in the column”The column in your marker holds a file name, a folder path, a file ID or a link to another website. Replace the value with a Drive link or a file chip. To keep using names, move them to the File Attachments column, or type the folder in the marker and use a pattern.
You also see this status when a pattern starts with a merge field, like {{Embed File, {{Invoice Number}}.pdf}}. Type the folder first.
Invalid attachment - Embed File can’t use … from the sheet inside a file path
Section titled “Invalid attachment - Embed File can’t use … from the sheet inside a file path”The value that fills your pattern has a slash, a backslash or a file ID in parentheses. Remove that character or file ID from the cell. A pattern can take a file name from the row, not a folder.
Invalid attachment - File is unavailable
Section titled “Invalid attachment - File is unavailable”No file in your Drive has that name or path, or the file isn’t shared with the account that runs the merge. Check the spelling and the extension. If the name has a comma, put the name in quotes. For a file in a shared drive, use its Drive link.
No file was attached and there is no error
Section titled “No file was attached and there is no error”The cell is empty for that row, the column title in the marker is misspelled, or the marker is in the subject. Send yourself a test email after you fix the problem.
