Mail_OnStartRender

The Mail_OnStartRender event occurs when rendering starts for a mailing receiver. The Mail_OnStartRender event is a good time for you to set any receiver-wide variables, because they will be set before any contents are rendered.

Syntax

Sub Mail_OnStartRender
. . .
End Sub

Parameters
None
Example

Sub Mail_OnStartRender()
    ' Sets a X-Subscriber-ID: header field to trace the subscriber if the mail fails
    Mail.Headers("X-Subscriber-ID") = Record.Fields("ContactID")
    ' Sets that today's subject 
    Mail.Subject = FormatDateTime(Date,2) & ": Today's F1 racing news"
    ' Remove non necessary mail contents
    If Record.Fields("PreferredFormat") = "PDF" Then
        Mail.Contents.Remove("HtmlNews")
        Mail.Contents.Remove("TextNews")
    Else If Record.Fields("PreferredFormat") = "HTML" Then
        Mail.Contents.Remove("PDFNews")
        Mail.Contents.Remove("TextNews")
    Else ' The subscriber wants a text based email
        Mail.Contents.Remove("PDFNews")
        Mail.Contents.Remove("HtmlNews")
    End If
End Sub

Remarks

Receivers set in the Record object as well as predefined content files will be added before Mail_OnStartRender is called.

Applies To

Mail Object

See Also

Mail_OnEndRender, Mailing_OnStartRender



©2001-2015 eMill. All trademarks property of their owners.