How to use macros in templates

In Shared Email Templates for Outlook

Macros let you not only avoid performing repetitive actions but also add dynamic content, drop-down lists and fillable fields to templates. For example, macros allow creating templates with attachments, so that each time you write a certain kind of message, you don't have to remember to add a particular file. You can fill in the Bcc, Cc, Subject email fields, add information to the message body, and a lot more.

On this page, find the instructions on how to use macros. You can also refer to the –°omplete list of macros to get the list of all macros and their descriptions.

Note. The add-in supports a maximum of one nested level of macros. For instance, you can put a macro into another macro, e.g. ~%Macro1[~%Macro2], and this will work fine. But if you add another nested level, e.g. ~%Macro1[~%Macro2[~%Macro3]], the tool will not work.

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

Download cheat sheet

How to add macro to your template

To add a macro, take the following steps:

  1. Select an existing template or create a new one and click Edit:
    Edit template.
  2. In the text of the template, place the cursor where you want to put a macro and click the Insert Macro icon:
    Insert Macro.

    Into the Search box, type any words to look for the macro. Double-click the macro you need or select it and click Select:
    Select your macro.

    The macro is inserted and now the recipient's full name will be pasted automatically each time you use the template.

    Note. In the text of a template, a macro is shown with a macro placeholder:

    This is a template with the inserted macro.

    Note. A macro placeholder appears in the text of a template only if you add a macro using the Insert Macro icon. If you enter a macro manually starting with the ~% symbols and following the syntax described on this help page, the macro won't be replaced with a placeholder. It will be shown as is:

    This is a macro as is.

What macros do and how to use them

Find the activity you'd like to implement and the corresponding macro you can use. If this is your first acquaintance with macros, we recommend that you read this section carefully and try out all the macros yourself to discover how they can simplify your emailing routine.

Tip. You can use nested macros as long as they do not exceed one nested level.
For example, feel free to create such macros as ~%FillSubject[~%Date], ~%WhatToEnter[~%InsertRecipientFirstName;~%To], ~%AddSubject[Dear ~%InsertRecipientFullName], etc.
Note. Please keep in mind that the entire macro text has to be of consistent formatting, otherwise the macro won't work:

If your macro may have inconsistent formatting, select the entire macro text and click the Clear Formatting icon in the toolbar:

Fill in email fields: To, Cc, Bcc, Subject

Note. With all macros in this group, it doesn't matter where in the text of a template you insert a macro. These macros put the needed information into the email fields, you won't see them in the message body.
Tip. By default, if the Subject field of the email you are going to send is empty, it will be filled with the name of a template. If you do not want this to happen, use the ~%FillSubject or ~%AddSubject macro without filling in the Fill Subject line/Add to Subject line box that the macro's dialog window contains. In this case, there won't be any text inside the macro's square brackets that you can see in the template content and HTML: ~%FillSubject[] or ~%AddSubject[].
  • The ~%FillTo, ~%FillCc, ~%FillBcc macros insert the specified email addresses (separated by semicolons) into the To, Cc, Bcc fields accordingly. Any previously added addresses will be deleted.
  • The ~%FillSubject macro inserts the specified text into the Subject field. Any previously added text in the Subject field will be deleted.
  • The ~%AddTo, ~%AddCc, ~%AddBcc macros add the specified email addresses (separated by semicolons) to the To, Cc, Bcc fields accordingly. All the previously added addresses will be kept.
  • The ~%AddSubject macro adds the item to the Subject field. The previously added to the Subject field text will be kept.

    Tip. By default, the macro adds text to the end of your Subject, so if you already have "Subject 1" in your Subject field and use ~%AddSubject[Subject 2], you'll get "Subject 1Subject 2".

    However, if you want the text to be added to the beginning of your Subject, you can use the ";{before}" element after your text in square brackets: ~%AddSubject[your text;{before}].

    So, to get "Subject 2Subject 1" in your Subject field, use the macro as follows: ~%AddSubject[Subject 2;{before}].

    Tip. When you use ~%AddSubject, the utility doesn't add any separators or spaces between the inserted text units in the Subject field, so don't forget to add a space or separator yourself if necessary.

    To use the macro, insert it into your template replacing "example@domain.com"/"Text" with the necessary email address/text in the macro's dialog window.

    Examples of use:
    ~%FillTo[example@domain.com]
    ~%FillCc[example@domain.com]
    ~%FillBcc[example@domain.com]
    ~%FillSubject[Text]

    ~%AddTo[example@domain.com]
    ~%AddCc[example@domain.com]
    ~%AddBcc[example@domain.com]
    ~%AddSubject[Text]

Known issue. Please note that email addresses, text, and the macro must be of consistent formatting. If you copy an email address or text from some other resources or a web page, they will be pasted into a template in their original formatting, and the macro won't work. So, we recommend that you type in the needed text manually to avoid formatting problems.

How to attach files to emails with macros

  • To attach files, you can use the ~%AttachFromOneDrive, ~%AttachFromSharepoint, ~%AttachFromURL, and ~%WhatToAttach macros. Please see the detailed guide on the How to attach files to your templates page.

How to insert images into message body with macros

  • To insert images, you can use the ~%InsertPictureFromOneDrive, ~%InsertPictureFromURL, ~%InsertPictureFromSharePoint macros. Please see the detailed guide on the How to insert pictures into your templates page.

How to add information to message body

Add subject, date, time

Note. As these macros add information to the message body, make sure to put the cursor right to the place of a template where you want to see this information.
  • The ~%Subject macro inserts the content of the Subject field into the message. The ~%Date and ~%Time macros add the current date and current time to the message.

    Examples of use:
    If you have any questions regarding ~%Subject, please let me know.
    This message is composed and sent on ~%Date.
    This message is composed at ~%Time.

Add addresses from To, Cc, Bcc fields

  • The ~%To, ~%Cc, ~%Bcc macros insert the content of the To, Cc, or Bcc fields accordingly into the message.

    Examples of use:
    The information contained in this message is intended only for ~%To.
    Please note, the copy of this message is sent to ~%Cc.
    Please note, the copy of this message is sent to ~%Bcc.

Insert recipient and sender names

Note. These macros may not work in some cases because of Outlook bugs.
  • The ~%InsertRecipientFirstName, ~%InsertRecipientFullName, ~%InsertRecipientLastName macros insert the first, full, or last name of the recipient into a message if the name is displayed in the To field. Otherwise, the email address is inserted.

    Examples of use:
    Hi ~%InsertRecipientFirstName
    Dear ~%InsertRecipientFullName
    Dear Mr. ~%InsertRecipientLastName

  • The ~%InsertSenderFirstName, ~%InsertSenderFullName, ~%InsertSenderLastName macros insert the first, full, or last name of the sender into a message.

    Examples of use:
    Warm regards, ~%InsertSenderFirstName
    Sincerely, ~%InsertSenderFullName
    Best wishes, ~%InsertSenderLastName

Paste profile and team properties

Add value from dataset

Enter text or pick date with ~%WhatToEnter macro

Clear message body & check account

  • The ~%ClearBody macro clears the message body when you insert a template into your message. So, if you may have some unneeded text in your message body, use this macro in your templates.
  • If you have several email accounts or use shared mailboxes, pick ~%FromAccount to enable inserting templates only into emails of the specified email account. After you click the Paste icon to insert your template, the macro will check if the email address in the From field is the same as the email address you entered into the From account box of the macro's dialog window. If they are different, the template won't be pasted.

Add inner note to template

  • You can use the ~%Note macro to leave an inner note in a template for yourself or your teammates. The macro is present only in the template itself. It doesn't change the message.

    Examples of use:
    ~%Note[Only for corporate customers]

    In the preview mode, when you stand on the template, your note looks like this:
    Closed note in the preview.

    To see the text of the note, simply hover the cursor over the macro placeholder. To open the note, click the macro placeholder:
    Opened note in the preview.

Create meetings and appointments in Outlook Calendar

You can create appointments and schedule meetings with the help of templates and use the ~%FillLocation, ~%AddLocation, ~%Location, ~%FillSubject, ~%AddSubject, ~%AddTo, ~%FillTo, ~%AddCc, ~%FillCc macros to fill in some fields.

See the detailed manual on the Use Shared Email Templates in Outlook Calendar page.

Add merge fields

To personalize templates for mail merge campaigns, use the ~%MergeField macro. Here is the manual: Personalize mail merge template

–°omplete list of macros

You can find the full list of all Shared Email Templates macros with their syntax and examples on the Complete list of macros page.