Automatically create a PDF from a Google document and send it via email.
-
Open a new Google document
-
Click on 'Tools > Script editor'
-
Copy the code in this repository in new scripts files inside your new App Script project
-
In the pdf.gs code, substitute:
- [INSERT EMAIL] at line 12 with the recipient / recipients of the email (if multiple, separate emails with comma)
- [INSERT IMAGE URL] at line 13 with the URL of the image you want to include in the email body after text
- [INSERT EMAIL SUBJECT] at line 16 with the desired email subject
- The text of the string at line 17 with your own text; this will be the email content, the HTML tag
serves as line break - [EMAIL SENDER VISUALIZED NAME] at line 20 with the desired sender's name
- "Hello" at line 26 with the desired fallback body text, for devices uncapable of rendering HTML
-
Save all files in the App Script project and close it
-
Refresh the document page, update its content and click on the menu to 'Email > Send PDF'
-
Your document will automatically be exported in PDF and sent to the recipients specified in pdf.gs