Email message templates

The message templates are used in the message generation process. A message job can use a message template to provide notification. The template is the content of the message that is sent. For example, a message template can be a template for password recovery or a custom newsletters. Each message template can contain placeholders that will be replaced with specific property values. The IMessageTemplateRequest class specifies the required information and the MessageTemplateRequestProxy class implements it and you can use it as a parameter where the interface is needed.

Creating a persistent message template and using it with a new message job

The sample below demonstrates how to create a persistent message template with new message job:

Creating a new message template and use it with a new message job

The sample below demonstrates how to create a new message template with new message job:

Merging message templates with additional information

Merge operations take place when the Notification service prepares the message for sending. In general, the template placeholders are replaced with specified merge tags. There are system tags, such as Subscriber.FirstName Subscriber.LastName, but you can use custom tags, that you pass through the contextItems parameter of the Send method. For every merge tag to be parsed, it must be surrounded by {| and |} asin the code sample below. The custom merge tags have a higher priority than the system merge tags. If you specify a custom merge tag (pass it in the contextItems dictionary) that is identical to a system merge tag, that is used in the template, the custom merge tag value will be used to replace the placeholder.

Merging tags while creating a message template


The sample below demonstrates how to send message using merge tags in the message template:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?