PatronManager Help

How to Add Images to Email Templates

Updated on

Use this link to share with your colleagues:

How to Add Images to Email Templates: https://help.pm.leapevent.tech/a/1175218

 Images are a great tool to brand your organization's email templates, and can dramatically improve the look of common emails such as Ticket Order confirmations or Donation acknowledgments.

This article will go over:

  1. Uploading Images to your Documents Tab
  2. Adding your image to your Email Templates
  3. How to see a Preview of your email template

Uploading Images to your Documents tab

Before you can embed your image in your email template, you need to add it to your Documents tab.

Let's upload your image

Lightning currently doesn't have a Documents tab, so we will need to take a quick detour to Salesforce Classic to upload our image.

1. Click on the circular icon in the upper right corner of the page and click on the "Switch to Salesforce Classic" link

2. In Classic, Click on the "+" to bring up your All Tabs list

Click on the "+" to bring up your All Tabs list

3. Find the "Documents" tab and click on it

Find the "Documents" tab and click on that

4. Click "New Document"

Click "New Document"

5. Fill in the fields below

  1.  Give the image a name.
  2. Check the box to make it "Externally Available".
  3. Change the folder to "Shared Documents".
Give the image a name, check the box to make it "Externally Available," and change the folder to "Shared Documents"

6. Click "Choose File"

Click "Browse"

7. Find the image file on your computer, select it, and click "Open"

Your image should be around or under 100 KB. If the file is larger than this, adjust the image size or resolution using an editing program such as Photoshop, GIMP, or Canva.com.

Find the image file on your computer, select it, and press "Open"

8. Click "Save"

Click "Save"

9. Go back to the Documents tab, change the Folder to "Shared Documents" and click on the name of the image

Go back to the Documents tab, change the Folder to "Shared Documents" and click on the name of the image

10. Right click on the image itself (command + click on a Mac) and select "Copy Image Location" or "Copy Image Address"

While you're here, double check that the image is at or around 100 KB.

Right click on the image itself (command + click on a Mac) and select "Copy Image"

11. Click "Switch to Lightning Experience" to go back to Lightning

Once your images have been uploaded to your Documents tab and you've switched back to Lightning, you can start using them in your Email Templates.

8. Admire your work
Click here for detailed instructions

1. Click gear icon, then click Setup

2. Type "email templates" in the Quick Find bar, and click on Classic Email Templates

3. Check to make sure your in the  right folder for your email template

Emails related to Ticket Orders will generally be in the PatronTicket folder, and emails related to Donations will generally be in the PatronDonate folder. 

We've got a full breakdown for you too. 

4. Find the correct template, and take note of the Template Type it's using

This example is "Visualforce" type.

click on the Template you want to add the image to

5. Click on the Template you want to edit

5. Click on the Template you want to add the image to

6. Add the image to the Email Template

For Visualforce Template Types
1. Click Edit Template

Ignore the "Error occurred trying to load the template for preview: invalid ID field: null. Please try editing your markup to correct the problem" message at the top of your screen. This error is just letting you know that it needs more information before it can show a preview email, which we will do later in the article.

6. Click Edit Template
2. A note about the Visualforce template type

This template type includes both a plain text and HTML version. Since images can't be included in plain text, you will only add the image reference in the HTML version.

3. Navigate to where you want the image to appear

Scroll down to the HTML version, and find the "<messaging:htmlEmailBody >" tag. Locate the area of the email you want your image to appear. We recommend doing this at the top of the email, before the first <p> tag.

4. Paste in the code

Paste this text, replacing the text in quotation marks with your image's specifications.

  • Replace NAME_OF_THE_FILE with the name of your file you copied . Make sure you replace each space with an underscore.
  • Replace FILE URL with the Image URL you copied earlier from your Documents
  • If the image is larger than you'd like, you can resize the width with width="DESIRED WIDTH GOES HERE." The number represents the image width in pixels. We recommend starting around "200" for images that are in portrait format, and "500" for images that are in landscape format.
<apex:image id="NAME_OF_THE_FILE" value="FILE URL"   width="DESIRED WIDTH GOES HERE"/>
5. Double check your code
  • Make sure there's a closing quotation mark at the end of the URL (").
  • Double check that the tag ends with a backslash (/).
6. Click "Save"
For Custom Template Types
1. Click Edit HTML Version
6. Click Edit Template

You can have it appear at the top, or in the middle.

3. Paste in the code

Paste this text, replacing the text in quotation marks with your image's specifications.

  • Replace NAME_OF_THE_FILE with the name of your file. Make sure you replace each space with an underscore.
  • Replace FILE URL with the image you address you copied earlier from your Documents
  • If the image is larger than you'd like, you can resize the width with width="DESIRED WIDTH GOES HERE." The number represents the image width in pixels. We recommend starting around "200" for images that are in portrait format, and "500" for images that are in landscape format.
<img src="FILE URL" alt="NAME_OF_FILE" width="DESIRED WIDTH GOES HERE"/><br/>
4. Double check your code
  • Make sure there's a closing quotation mark at the end of the URL (").
  • Double check that the tag ends with a backslash (/).
5. Click "Save"

How to see a Preview of your email template

1. Click the "Send Test and Verify Merge Fields" button

You can ignore the "Error occurred trying to load the template for preview: invalid ID field: null. Please try editing your markup to correct the problem" message at the top of your screen. This error is just letting you know that it needs more information before it can show a preview email, which is what we're going to do.

2. In the pop-up window, search for an example Ticket Order, and click OK.

It doesn't matter which order you select, anyone will work.

3. Click "OK"

You can mark the "Send email preview to" checkbox and identify an email address where you would like to send the test so it can be reviewed by others.

4. Both HTML and Plain Text previews will appear at the bottom of your screen.

Previous Article So You Want to Get Started with Volunteers
Next Article All About CourseStorm and Class Registration
Still Need Help? Continue to the Client Community