Automatic PDF Export with Email Notification
Adding an email notification to automatic PDF exports keeps stakeholders informed without manual follow-up. The script exports the document, saves the PDF, and sends an email with a Drive link or the PDF attached.
Sending a notification with Drive link
After saving the PDF to Drive, get the file's share URL using file.getUrl(). Pass this URL to GmailApp.sendEmail() in the email body. Recipients click the link to access the PDF in Drive. This avoids email size limits and keeps the PDF in Drive's version history.
Sending the PDF as an attachment
For recipients who need the PDF as a standalone file, attach the PDF blob directly to the email. Pass the blob to the attachments parameter of GmailApp.sendEmail(). The PDF arrives as an attachment, no Drive access needed.
Customizing the notification email
Include the document name, export date, and a summary of what changed in the email body. If the script exports multiple documents, include a summary list with links to each. A clear, informative notification reduces the need for recipients to ask questions.
Frequently Asked Questions
How do I send an email when an automatic PDF export finishes?
Add GmailApp.sendEmail() to the end of your Apps Script function. Pass the recipient, subject, body, and optionally the PDF blob as an attachment.
Can I send the notification to multiple people?
Yes. Pass a comma-separated list of email addresses as the recipient, or loop through an array of addresses and call sendEmail() for each.
Related article
Google Docs to PDF with Gmail →Ready to Try It?
Install the free Chrome extension and start converting your Google Docs to PDF in one click.
Install Free Extension