---
title: Reference - Email marketing macro expressions
related:
  - https://docs.kentico.com/13/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-email-marketing/preparing-email-templates.md
  - https://docs.kentico.com/13/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-email-marketing/preparing-email-widgets.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

This page lists macro expressions available solely within the **Email marketing** application. To facilitate access, individual macro expressions are exposed via the following objects:

- [Recipient](#recipient)
- [Email](#email)
- [EmailFeed](#emailfeed)

To add these expressions, click **Insert macro** (  ) on the editor toolbar and select the appropriate option under the **Context specific objects** section.

> **Note:** **Notes**
>
> - All expressions described below are _context macros_, which means they must be enclosed in _{% %}_ parentheses when entered into text or other general fields.
> - For personalization of email widgets, we recommend using only the macros described below. Using other types of macros may significantly reduce the performance of the system.

## Recipient

The _Recipient_ entity exposes the following properties of individual recipients:

| Property  | Return type | Description                                                                                                                                                                                                                            |
| --------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FirstName | string      | Resolves into the _First name_ property of the recipient, as specified in the associated [contact](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management.md) information. |
| LastName  | string      | Resolves into the _Last name_ property of the recipient, as specified in the associated contact information.                                                                                                                           |
| Email     | string      | Resolves into the _Email_ property of the recipient, as specified in the associated contact information.                                                                                                                               |
| PersonaID | int         | Resolves into the _PersonaID_ property of the recipient, which identifies the [persona](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/personas.md) assigned to the recipient.        |

> **Note:** **Note**
>
> When processing macros for marketing emails, the system uses two separate resolving phases:
>
> - General macro expressions are resolved only once and the result is used for all email recipients
> - Macro expressions containing the _Recipient_ entity are resolved separately for each email recipient
>
> If you need to use variables from general macros within macros containing the _Recipient_ entity, add the **|(resolver)subscriber** parameter to the end of the expression that defines the variables. For example:
>
> ```csharp
>
> {% defaultText = "Hello there!" |(resolver)subscriber %}
> {% Recipient.FirstName == String.Empty ? defaultText : "Hello, " + Recipient.FirstName + "!"; %}
>
> ```
>
> The _(resolver)subscriber_ parameter added to the first macro ensures that the expression is resolved in the second phase along with the second _Recipient_ macro.
>
> **Important**: Only use the _(resolver)subscriber_ macro parameter for scenarios where variable sharing is necessary. The system resolves such expressions separately for each recipient, which may reduce performance when sending a large number of emails.

> **Info:** If no recipients are available when previewing emails containing the _Recipient_ macro, a fake contact with name **Anthony Stark** is used.

## Email

The _Email_ entity exposes properties of individual emails.

**Note**: The _Emai&#x6C;_&#x65;ntity and all its macros are only available when editing email templates of the _Email_ type and within the content of marketing email issues based on these templates.

| Property         | Return type | Description                                                                 | Notes                                                                                                                                                         |
| ---------------- | ----------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name             | string      | Resolves into the _Name_ property of the given email.                       |                                                                                                                                                               |
| Subject          | string      | Resolves into the _Subject_ property of the given email.                    |                                                                                                                                                               |
| Preheader        | string      | Resolves into the _Preheader_ property of the given email.                  | The usage of this macro in [open conditions or loops](https://docs.kentico.com/13/macro-expressions/macro-syntax.md#conditional-statements) is not supported. |
| SenderName       | string      | Resolves into the _Sender name_ property of the given email.                |                                                                                                                                                               |
| SenderEmail      | string      | Resolves into the _Sender email address_ property of the given email.       |                                                                                                                                                               |
| ViewInBrowserUrl | string      | Resolves into a URL  that allows recipients to view the email in a browser. |                                                                                                                                                               |

## EmailFeed

The _EmailFeed_ entity exposes the following properties of individual [email feeds](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/email-marketing.md#working-with-email-feeds):

| Property                        | Return type | Description                                                                                                                     | Notes                                         |
| ------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| Name                            | string      | Resolves into the _Name_ property of the email feed under which the macro resolves.                                             |                                               |
| SubscriptionConfirmationUrl     | string      | Resolves into a link to the subscription approval page, as defined by the _Approval page URL_ property of the given newsletter. | Only available for _Double opt-in_ templates. |
| UnsubscribeFromEmailFeedUrl     | string      | Resolves into a link to the unsubscription page, as defined by the Unsubscription page URL property of the given email feed.    |                                               |
| UnsubscribeFromAllEmailFeedsUrl | string      | Resolves into a link to the unsubscription page, as defined by the Unsubscription page URL property of the given email feed.    |                                               |

Furthermore, the following macro method can be used with the _EmailFeed_ entity.

| Method         | Return type | Parameters                                 | Description                                                                                                                                                                                                                                            |
| -------------- | ----------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| GetAbsoluteUrl | string      | EmailFeed emailFeed<br>string relativePath | Converts a relative path passed by the _relativePath_ parameter into an absolute URL (using the **Base URL** configured for the email feed represented by the _EmailFeed_ entity).<br>Example: _{% EmailFeed.GetAbsoluteUrl("/graphics/image.png") %}_ |
