ScribanEmailTemplateRenderer class
namespace: Serenity.Extensions assembly: Serenity.Extensions
The default IEmailTemplateRenderer, which reads the templates with Scriban, e.g. Dear {{ DisplayName }}, or {{ if Branch == "North" }}...{{ end }}.
public class ScribanEmailTemplateRenderer : IEmailTemplateRenderer
Public Members
| name | description |
|---|---|
| ScribanEmailTemplateRenderer() | The default constructor. |
| static readonly Default | A shared instance. |
| virtual Parse(…) | |
| static Escape(…) | Returns the text in a block that the template reads as it is, e.g. a name of a record that is rendered into the body of a personalized message, which must not be read as template text even if it has "{{" in it. The text is not HTML encoded here. |
Remarks
The values are written HTML encoded in an HTML template, unless they are written with raw, e.g. {{ raw Signature }} or {{ Signature | raw }}.
A value the template uses that is not given fails the rendering, so a mistyped name is not sent as an empty text.
The templates can't include other files, and their loops and recursions are limited, as they may be written by the users of an application.
See Also
- interface IEmailTemplateRenderer
- Source: ScribanEmailTemplateRenderer.cs