Udostępnij za pośrednictwem


How to Build Direct Mail Templates

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

You can personalize Direct Mail e-mail messages to users by using a custom ASP.NET Direct Mail template. To personalize content, you can retrieve information from the customer profile store and use it in personalized ASP.NET template code. For example, you can include the first name of the user in a personal greeting. You can add special text to the ASP.NET page for delivery. If you do not personalize messages, Commerce Server delivers the direct mail message as a plain HTML page; it composes the mail only one time and sends the same content to every e-mail recipient.

Personalized ASP.NET Web pages are specified in the Message Body Source of the Direct Mail Properties Screen, Base Properties Tab within a Marketing Manager Direct Mail definition, or programmatically in the SourceLocation property of the DirectMail object. For example, use https://localhost/yoursite/DirectMailPage.aspx as a SourceLocation. For an example, see How to Create a Direct Mail Item.

A sample ASP.NET template for direct mail personalization is available in the /Microsoft Commerce Server 2007/SDK/Marketing directory.

How to Track Click Events from Direct Mails

You can track Direct Mail click events by directing users to the Redir.aspx Web page, by using a hyperlink in your personalized direct mail messages. When the user clicks the link to Redir.aspx, Redir.aspx logs the click event using HTML query string variables. The redir.aspx code is included in the How to Track Marketing Events topic.

Redir.aspx accepts the following HTML query string variables:

  • HTML query string variable

  • Description

  • Ciid

  • The Campaign Item ID.

  • Cachename

  • The value "advertising" or "discounts".

  • Evt

  • The event type. The default event type is a "CLICK" event.

  • PageGroupId

  • The Page Group ID.

  • Url

  • The URL to redirect to after the click is logged by the CSFRecordEvent pipeline.

  • Target

  • The target HTML frame.

You can write markup in a personalized Direct Mail template to fill in these values. The values are included dynamically into a Redir.aspx URL in the following format. Commerce Server cannot automatically replace these values. You must write this markup yourself.

<AHREF="{%RedirectUrl%}?ciid={%item_id%}&amp;cachename={%CacheName%}&amp;evt={%Evt%}&amp;PageGroupId={%PageGroupId%}&amp;url={%ClickUrl%}" TARGET="{%Targetframe%}">{%Text%}</A>'

For example, you could direct the customer to a specific product with markup such as the following:

<AHREF="https://localhost/yoursite/redir.aspx?ciid=1&amp;cachename=advertising&amp;PageGroupId=-3&amp;url=https://localhost/yoursite/&amp;TARGET= ">Click here to view the product!</A>

See Also

Other Resources

Direct Mailer Service