How to insert pictures into your templates

In Shared Email Templates for Outlook

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.

Here is a quick How to insert pictures cheat sheet, click on the button below to download it:

Download cheat sheet

Before you start

Please go over the notes below before adding images.

  • To avoid signing in to your Microsoft account each time you insert images from OneDrive or SharePoint, enable the SSO option. Here are more details.
  • If you use ~%InsertPictureFromOneDrive in a template that is shared with other users, make sure that your teammates have access to the file or folder in OneDrive. You can learn more about managing access in OneDrive on the Share OneDrive files and folders page. You can create a special folder in your OneDrive, share it with all your teammates, and collect all the images you share in templates there.
  • If you use ~%InsertPictureFromSharePoint in a template that is located in a team and shared with other users, make sure that your teammates have access to the file or folder in SharePoint. You can learn more about managing access in SharePoint on the Share SharePoint files or folders page.
  • When you use a template with the ~%InsertPictureFromOneDrive or ~%InsertPictureFromSharePoint macro, the macro downloads the chosen file and attaches it to the currently open email message.
  • When you use a template with the ~%InsertPictureFromSharePoint macro, you have to be logged in to SharePoint so that the macro has access to the file.
  • ~%InsertPictureFromSharePoint will not work on free accounts, such as Outlook.com, as they do not have SharePoint.
  • If you use the ~%InsertPictureFromURL macro in a template that is shared with other users, make sure that your teammates have access to the URL you indicate in the macro.

Insert image from OneDrive

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:
Insert Macro.

Into the Search box, type "insertpicture" to look for the macro. Double-click ~%InsertPictureFromOneDrive or select it and click Select:
Select your macro.

Tip. You can find the detailed manual on how to use macros here: How to use macros in your templates

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.

If the image is in OneDrive, select it and click Select. Also, you can Upload an image from your local storage to OneDrive and then attach it:

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:
Resize your image.
If you do not enter any size, the image will be inserted in its original dimensions.

When the macro is created, you can click on it and select to Open file or Open folder:
Open file or open folder from OneDrive.

Add picture from SharePoint

To add an image from SharePoint, open your template and click the Insert macro icon:
Insert Macro.

Into the Search box, type "insertpicture" to look for the macro. Double-click ~%InsertPictureFromSharePoint or select it and click Select:
Select your 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.

If the image is in SharePoint, select it and click Select. Also, you can Upload an image from your local storage to SharePoint and then attach it:

Select a picture to insert from SharePoint.

You'll see the Insert picture window:
Resize your image.

If required, you can set the size of an image (in pixels) and click Insert.

When the macro is created, you can click on it and select to Open file or Open folder:
Open file or open folder from SharePoint.

Insert image from URL

Another way to add a picture to your template is to attach an image from a URL. Click the Insert macro icon:
Insert Macro.

Into the Search box, type "insertpicture" to look for the macro. Double-click ~%InsertPictureFromURL or select it and click Select:
Select your macro.

Enter the URL, set a size of a picture or leave these fields empty and click Insert:
Resize your image.
If you do not enter any size, the image will be inserted in its original dimensions.

What not to do while inserting images from URL

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.

Add image in HTML

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:
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">

If you want to insert your image in its original dimensions, you can indicate no size, and the tag will look like this: <img src="https://cdn.company.com/logo.png">

Tip. You can also indicate the size of the inserted image in percentage of its original size, so the tag may look as follows: <img src="https://cdn.company.com/logo.png" width="80%" height="80%">

Click OK:
Add the HTML tag.

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.

Note. If you use the <img> HTML tag in a template that is shared with other users, make sure that your teammates have access to the URL you indicate in the tag.

Use Outlook draft with image inserted

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

Single sign-on (SSO) for OneDrive and SharePoint macros

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:
Requested permissions.

After that, all images will be inserted without any additional pop-ups.

Disable single sign-on

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 Profile.

Click Edit Account:
Edit Account.

Here is the checkbox you need:
Single sign-on checkbox.

Important notes

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.

Note. Please note, the single sign-on feature:

  • Is not supported in the web app–it is available only in the Outlook add-in (desktop or online).
  • Is available only if your Outlook provides mailbox API 1.9 and higher.
  • Works in Microsoft 365 accounts only and is not supported for free outlook.com accounts.

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.

You can find plenty of useful information on this topic in our blog articles: