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:
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.
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
5. Fill in the fields below
- Give the image a name.
- Check the box to make it "Externally Available".
- Change the folder to "Shared Documents".
6. Click "Choose File"
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.
8. Click "Save"
9. 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.
Adding your image to your Email Templates
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.
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.
6. Add the image to the Email Template
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.
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"
1. Click Edit HTML Version
2. Navigate to where you want the image to appear
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.