On this page, you will find several ways to insert an image into your templates in Shared Email Templates. You can attach pictures from OneDrive or URL, add the <img> tag directly to the HTML code, or create an Outlook draft, insert an image to it, and use this draft as a template.
The first way to insert an image to your template is to attach one from OneDrive with the help of the InsertPictureFromOneDrive macro. To use the macro, open your template and click the Insert macro icon:
In the drop-down list, select the InsertPictureFromOneDrive macro:
If single sign-on is not enabled, when you pick the InsertPictureFromOneDrive macro, the add-in will ask to log in to your OneDrive account.
Choose a picture to insert into your email:
You can set a size of an image (in pixels) or leave these fields empty and click Insert:
If you do not enter any size, the image will be inserted in its original dimensions.
When you use a template with this macro, the macro downloads the chosen image, inserts a hidden attachment and displays it in the message body.
To add an image from SharePoint, use the InsertPictureFromSharePoint macro:
If single sign-on is not enabled, when you pick this macro, the add-in will ask you to log in to your SharePoint account.
Select a picture to insert into your email:
You'll see the Insert picture window:
If required, you can set the size of an image (in pixels) and click Insert.
If in your templates you use images from OneDrive or SharePoint and you've got only one OneDrive account that is the same as your Microsoft 365 Outlook account (that is indicated in Outlook File → Account information), you can take advantage of single sign-on to avoid entering or confirming your credentials each time you use the InsertPictureFromOneDrive and InsertPictureFromSharePoint macros.
With single sign-on, you will only once accept the permissions for the app:
After that, all images will be inserted without any additional pop-ups.
The single sign-on feature is turned on by default. If you may use images from different OneDrive accounts, turn single sign-on off. For this, click the three dots in the bottom right corner of the add-in pane and select Profile:
Click Edit Account:
Here is the checkbox you need:
Below the checkbox, you may see an error message in red, in most cases, the message would be connected to one of the listed below points.
But if you are seeing the 'SSO is not supported in your current add-in version' message, most probably, you simply need to wait a bit till the app will be updated in your account. The speed of this process depends on Microsoft and we can't influence it.
Another way to add a picture to your template is to attach an image from a URL by using the InsertPictureFromURL macro. Open your template and click the Insert macro icon:
In the drop-down list, select the InsertPictureFromURL macro:
Enter the URL, set a size of a picture or leave these fields empty and click Insert:
If you do not enter any size, the image will be inserted in its original dimensions.
When you use a template with this macro, the macro downloads the chosen image, inserts a hidden attachment and displays it in the message body.
Friends, please, if you want to add an image from OneDrive or SharePoint, use the InsertPictureFromOneDrive and InsertPictureFromSharePoint macros only.
Do not try to use the InsertPictureFromURL macro and put a link to your file from OneDrive or SharePoint into square brackets.
For instance, you may open your picture in a browser, copy its address from the address bar, and try to use it in the InsertPictureFromURL macro. This won't work. Also, if you copy a link to your image while sharing it in OneDrive and paste it into square brackets in the InsertPictureFromURL macro–this won't work too.
Besides, you can edit the HTML code of you templates and use the <img> tag to add a picture to your template. Create a template or open an existing one and click the View HTML icon:
Enter the <img> tag with a URL and size of your image. For instance, if a picture is located at https://cdn.company.com/, named "logo.png", and should be pasted in the 150px width and 80px height size, the tag will look like this:
<img src="https://cdn.company.com/logo.png" width="150" height="80">
Click Update:
Your image will be displayed in your template but not downloaded and attached, so if it gets unavailable by the URL, it won't be pasted and displayed in your messages.
Another way to insert an image into your template is to use Outlook drafts as templates. In this case, you create a draft in Outlook, insert an image, and link the folder with this draft to Shared Email Templates. Here is our guide on how to use linked folders:
How to use Outlook drafts as templates
You can find plenty of useful information on this topic in our blog articles: