Images from SharePoint Function in your Mail Signature Template

  • Last updated on November 29, 2024 at 10:26 AM

officeatwork signature templates support linked images from SharePoint in the template. You can link any number of images to each signature template individually. This is mostly used when the image is dynamically added based on other criteria like, for instance, the user's department.

If your images are static and do not need to be in SharePoint then please use the local image feature as this will be faster for your users when inserting the image into mails or appointments!

Adding a linked Image from SharePoint

Follow the steps below to add a linked image from SharePoint to your signature template while editing your signature template

  • Click on the 'Functions' dropdown and choose the 'loadImageFileFromSharePoint' option.
    • A sample snippet will be inserted into your template
      {% var logo = loadImageFileFromSharePoint('https://tenant.sharepoint.com/_layouts/15/images/siteIcon.png') %}{% if logo %}
          <img src="{{ logo.cid }}"/>
      {% endif %}
  • Change the URL to the one you want to link to in your tenant

Please note that the snipped first defines a variable that links to the image. Then if has a condition, make sure that the image exists. This helps avoid errors in inserting the signature with broken image links.

Using SharePoint metadata of an Image from SharePoint

The loadImageFileFromSharePoint function retrieves an image file from SharePoint and also retrieves the metadata associated with the linked image. This metadata can be utilized in the Signature template to dynamically modify values based on the linked image.

Here's a sample scenario demonstrating the usage of the loadImageFileFromSharePoint function to dynamically set the link of an image using the 'url' field.

{% var logo = loadImageFileFromSharePoint('https://tenant.sharepoint.com/_layouts/15/images/siteIcon.png') %}
{% if logo %}
    <a href="{{ logo.fields.url }}"><img src="{{ logo.cid }}" ></a>
{% endif %}