Detecting render mode

Depending on the type of rendering Outbound E-mail is performing, you may want to execute different code. Outbound E-mail has three rendering modes:

  • Publish—rendering for publication to a deployment server
  • Preview—rendering for a preview in the GUI
  • E-mail—rendering when testing or sending a Mailing

To distinguish between these, you can use the following sample code:

          Dim lStrTemplateMode 
          
          If RenderMode = "PreviewDynamic" Then
													If PublicationTargetID = "tcm:0-0-0" Then
              	lStrTemplateMode = "Preview"
             Else
               lStrTemplateMode = "E-mail"              
          End If
          Else
	              lStrTemplateMode = "Publish"
          End If