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.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. 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?