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.

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:
Click the Insert macro icon.

In the drop-down list, select the InsertPictureFromOneDrive macro:
Select InsertPictureFromOneDrive.

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.

Choose a picture to insert into your email:
Select a picture to insert from OneDrive.

Tip. You can switch to another OneDrive account by clicking the Blue Cloud icon on the right.

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 you use a template with this macro, the macro downloads the chosen image, inserts a hidden attachment and displays it in the message body.

Note. 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.
Tip. For your convenience, you can create a special folder in your OneDrive, share it with all your teammates, and collect all the documents you share in templates there.
Tip. 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, use the InsertPictureFromSharePoint macro:
Select InsertPictureFromSharePoint.

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:

Select a picture to insert from SharePoint.

Tip. You can switch to another SharePoint account by clicking the Switch SharePoint account icon on the right.

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.

Note. 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.
Note. Please note, the InsertPictureFromSharePoint will not work on free accounts, such as Outlook.com, as they do not have SharePoint.
Tip. 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.

Single sign-on 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 in free accounts, such as outlook.com or gmail.com

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.

Insert image from URL

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:
Click the Insert macro icon.

In the drop-down list, select the InsertPictureFromURL macro:
Select InsertPictureFromURL.

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

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.

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.

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

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

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%">
Tip. 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">

Click Update:
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

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

Ask a question (posted publicly)

If you have any questions or issues with this add-in, please feel free to post your concerns in the comments area. As soon as we answer, a notification message will be sent to your e-mail. If you do not want to share your thoughts in public, please contact us at support@ablebits.com.