In this tutorial, we’ll be taking the HTML code from a Postcards template and adding it to an email in Gmail.
- Designmodo account
- Gmail account
- Text editor that can open HTML files
Important! Updated Version Video
1. Create and export a Postcards template
The main thing we need is a Postcards template for the HTML code.
In the Postcards app, create a template. Mine looks like this:
Next, we want to export this and use the HTML code that’s generated.
In the top right corner of the app, press “Export” and press “Download as zip.”
There will be an option called “Host images online.” Make sure this option is checked. Your screen should look like this:
Press “Download Zip” and extract the file into a folder. My folder looks like this:
If you open this file in your browser, you should see the Postcards template you just created.
Now, we have everything we need to add this template to a Gmail email.
2. Create a new draft and open developer tools
Next, create a new draft and type anything in the body, highlight the text, right-click it, and press “inspect,” like this image.
That will open the developer tools where you can edit the code directly in the browser. Your screen should look something like this:
Now, we need the code generated by the Postcards template to add into the dev tools.
Open the index.html file you just downloaded in a text editor. I’m using Notepad++, and it looks like this:
3. Edit the HTML contents in the developer tools using the generated HTML
Highlight all the contents in the HTML file and copy it.
Go back to Gmail and in the developer tools, right-click the highlighted HTML element that was opened when you pressed “Inspect” on the highlighted text and select “Edit as HTML.” Your screen should look like this:
That will open up a text editor containing the contents of the HTML element containing the “anything” text.
Highlight the “anything” text, not the outer HTML element, and replace that with the Postcards HTML template that you had copied. The dev tools should look like this now:
Click anywhere outside of the textbox area to confirm the changes. Your screen should look like this:
You can now close the dev tools.
The “anything” text was replaced with the HTML code of the generated Postcards template. That inserts the email template in the body of your email.
Now you should have the Postcards template in a Gmail email!
You can send yourself a test email to see if the template looks the way you expect.
What we covered
- How to export a Postcards template as an HTML file.
- How to open the developer tools and edit the code in a Gmail draft.
- How to add the Postcards generated HTML to the body of a Gmail draft.