Partilhar via


ComposeDMLMessage

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

Use the ComposeDMLMessage pipeline component to create the body of a direct mail message.

Intended use: DirectMailer pipeline, Compose E-mail stage.

Values Read

The ComposeDMLMessage pipeline component reads the following values from the indicated dictionaries.

Key

Dictionary

Description

rcp_bypass

Order

Boolean. The component bypasses (skips) processing if True.

use_precomposed_body

Order

Boolean. If True, the component creates the message from the plain-text body assigned to the precomposed_body key.

precomposed_body

Order

Optional. The plain-text message body. This key defaults to an empty string.

rcp_url

Order

Optional. The URL used to retrieve the mailing content. This takes precedence over the default_url key.

rcp_url_isfile

Order

Optional. This is True if the URL for the content (rcp_url) is a file and not an http:// address.

rcp_url_content

Order

Optional. The content of the file pointed to by the rcp_url key if the rcp_url_isfile key is True.

from_field

Order

The "From" field for the message.

replyto_field

Order

The "Reply-to" field for the message.

rcp_email

Order

The e-mail address of the recipient.

subjects_dict

Order

rcp_formatting

Order

Determines the format of the message. The values are:

  • 0. Default formatting

  • 1. Plain text

  • 2. MIME

  • 3. MHTML

This key overrides the default formatting.

rcp_personalize

Order

Indicate whether or not to personalize the message for this recipient. The values are:

  • 0. Do not personalize

  • 1. Personalize

This key defaults to 1 (personalize).

rcp_charset

Order

rcp_language

Order

default_language

Order

Optional.

default_charset

Order

Optional.

rcp_locale

Order

The locale code to use for the recipient.

cookie

Order

The dictionary containing the cookie data.

cdo_message

Context

A reference to the Collaboration Data Objects (CDO) message object (CDO.Message).

cdo_config

Context

A reference to the CDO configuration object (CDO.Configuration).

default_url

Context

Optional. The URL used to retrieve the mailing content.

default_url_isfile

Context

Optional. This is True if the default URL is a file path and not an http:// path.

default_url_content

Context

Optional. The content of the file pointed to by the default_url key if the default_url_isfile key is True.

default_formatting

Context

Optional. The default format for the message. The values are:

  • 0. Default formatting

  • 1. Plain text

  • 2. MIME

  • 3. MHTML

cdo_CreateMHTMLBodyFlags

Context

Optional. Responsible for controlling whether objects in the email message are embedded or not. If this key is not set, objects in the e-mail are embedded. If the key is set to the appropriate value (31), the direct mail message body contains the output of the target web page as is.

For example, if MailFormat is set to 3 (MHTML), and the CreateMHTMLBodyFlags is set to 31, the mail message body snippets is:

<img src=www.microsoft.com/banner.jpg height=100 width=100>

If MailFormat is set to 3 (MHTML), and the CreateMHTMLBodyFlags is not set, the mail message body snippets is:

<img src=cid:000101c1c44f$1bf3a256$_CDOSYS2.0 height=100 width=100 />

To set this key, you typically add a scriptor component preceding the ComposeDMLMessage pipeline component to the current stage with the following code:

function MSCSExecute(config, orderform, context, flags)
context("cdo_CreateMHTMLBodyFlags") = 31
MSCSExecute = 1
end function
sub MSCSOpen(config)
end sub
sub MSCSClose()
end sub

Values Written

The ComposeDMLMessage pipeline component writes the following values to the Order dictionary.

Key

Description

cdo_result

The result code (an HRESULT) from the most recent CDO operation.

cdo_error

Optional. An error string from the most recent CDO operation, if any. NULL if there is no error.

The ComposeDMLMessage pipeline component writes the following values to the Context dictionary.

Key

Description

cdo_message

A reference to the CDO message object (CDO.Message).

Remarks

The ComposeDMLMessage pipeline component skips processing if the bypass flag (rcp_bypass) is True. Otherwise, it uses the Collaboration Data Objects (CDO) for Microsoft Windows 2000 to create the mail message. The ComposeDMLMessage pipeline component checks for errors after each CDO operation.

For non-personalized messages using a simple flat file, you can set the use_precomposed_body key to True. The component will load the message body from the precomposed_body key.

For personalized messages, the ComposeDMLMessage pipeline component uses the information gathered by the CreateUPMCookie component to create the cookie string.

The ComposeDMLMessage pipeline component can process multilingual messages using locale values from the Order dictionary (the rcp_locale key or the default_locale key). The locale values are passed to the CDO without checking. If no locale code is given, the CDO default locale is used.

If a file path is used for the rcp_url key or the default_url key, Direct Mailer preloads the content of the file (into the rcp_url_content key or the default_url_content key) in order to improve performance. In this case, message content is limited to 2 megabytes for plain ASCII text and to 1 megabyte for Unicode text.

See Also

Other Resources

Pipeline Component Reference

AddAttachments

CreateUPMCookie

SendPrecomposedMessage

ThrottleDMLPerformance

VerifyMessageBody

VerifyRecipientData