Scheduled PDF Export With Email Notification on Completion
A scheduled export that runs silently gives you no confidence it worked until you go check. Adding an email notification at the end of the script takes two lines of code and tells you every time the export completes, what it converted, and whether anything failed.
Adding the notification to your script
At the end of your export function, add: MailApp.sendEmail('your@email.com', 'PDF Export Complete', 'Converted ' + successCount + ' files. Failed: ' + failCount); Replace the counts with variables you track during the loop. The email arrives within a few minutes of the export completing.
What to include in the notification
Useful information in the notification includes the source folder name, the destination folder name, the number of files successfully converted, the number of failures with file names, and the date and time of the run. A well-formatted notification is enough to confirm the export without logging into Drive.
Failure-only notifications
If successful runs happen frequently, you may only want notifications for failures. Add a conditional: only call MailApp.sendEmail() if failCount is greater than zero. This keeps your inbox clear on normal runs and alerts you only when something goes wrong.
Frequently Asked Questions
Can I send the notification to multiple email addresses?
Yes. Separate multiple addresses with commas in the second argument of MailApp.sendEmail(), or use the advanced options to add cc and bcc recipients.
Does the email notification count against Google's email sending limits?
Yes. Google limits MailApp.sendEmail() calls per day per account. For daily scripts, one email per run is well within the limit.
Related article
Set up a workflow to convert Google Docs to PDF →Ready to Try It?
Install the free Chrome extension and start converting your Google Docs to PDF in one click.
Install Free Extension