Click or drag to resize

Template Class

Represents the template that can be used to create email messages.
Inheritance Hierarchy
SystemObject
  Limilabs.Mail.TemplatesTemplate

Namespace:  Limilabs.Mail.Templates
Assembly:  Mail (in Mail.dll) Version: 3.0.23341.1754
Syntax
public class Template

The Template type exposes the following members.

Properties
  NameDescription
Public propertyItem
Gets or sets custom keys used by this template.
Top
Methods
  NameDescription
Public methodAddKey
Adds a custom key used by this template.
Public methodClearDataSources
Clears all data sources for this template.
Public methodStatic memberCreate
Creates new template using specified template text.
Public methodDataFrom(IDictionary)
Specifies IDictionary that will be used as a data source for this template. If the method is called more than once, only last object is used as the template data source.
Public methodDataFrom(Object)
Specifies object that will be used as a data source for this template. If the method is called more than once, only last object is used.
Public methodDataFrom(ITemplateDataProvider)
Specifies ITemplateDataProvider that will be used as a data source for this template. If the method is called more than once, only last object is used as the template data source.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberFromFile
Loads a template from file.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPermanentDataFrom(IDictionary)
Specifies IDictionary that will be used as a data source for this template. If the method is called more than once, all objects are checked and used as the template data source.
Public methodPermanentDataFrom(Object)
Specifies object that will be used as a data source for this template. If the method is called more than once, all objects are used.
Public methodPermanentDataFrom(ITemplateDataProvider)
Specifies ITemplateDataProvider that will be used as a data source for this template. If the method is called more than once, all objects are checked and used as the template data source.
Public methodRender
Renders the template.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
string text = Template
    .LoadFromFile("template.txt")
    .DataFrom(reportData)
    .Render();
Template sample:
            Hi [FirstName] [LastName],
            
            On [PurchaseDate:yyyy/MM/dd HH:mm] you purchased following items:
            [foreach OrderItems]
                - [Id] [Name] [Price]
            [end]
            \[ escaped square brackets \]
            
See Also