Commerce Server 2002 SDK
ComposeDMLMessage

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

Although the component appears as ComposeDMLMessage in the Pipeline Editor, its ProgID is Commerce.DMLComposeMessage.

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

Configuration Values

None.

Values Read

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

KeyDictionaryDescription
rcp_bypassOrderBoolean. The component bypasses (skips) processing if True.
use_precomposed_bodyOrderBoolean. If True, the component creates the message from the plain-text body assigned to the precomposed_body key.
precomposed_bodyOrderOptional. The plain-text message body. This key defaults to an empty string.
rcp_urlOrderOptional. The URL used to retrieve the mailing content. This takes precedence over default_url key.
rcp_url_isfileOrderOptional. This is True if the URL for the content (rcp_url) is a file and not an http:// address.
rcp_url_contentOrderOptional. The content of the file pointed to by the rcp_url key if the rcp_url_isfile key is True.
from_fieldOrderThe "From" field for the message.
replyto_fieldOrderThe "Reply-to" field for the message.
rcp_emailOrderThe e-mail address of the recipient.
subj_fieldOrderThe "Subject" field for the message.
rcp_formattingOrderDetermines 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_personalizeOrderIndicate 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_localeOrderThe locale code to use for the recipient.
default_localeOrderOptional. The locale code to use if there is no recipient locale code (rcp_locale).
cookieOrderThe dictionary containing the cookie data.
cdo_messageContextA reference to the Collaboration Data Objects (CDO) message object (CDO.Message).
cdo_configContextA reference to the CDO configuration object (CDO.Configuration).
default_urlContextOptional. The URL used to retrieve the mailing content.
default_url_isfileContextOptional. This is True if the default URL is a file path and not an http:// path.
default_url_contentContextOptional. The content of the file pointed to by the default_url key if the default_url_isfile key is True.
default_formattingContextOptional. The default format for the message. The values are:

0 — Default formatting

1 — Plain text

2 — MIME

3 — MHTML

cdo_CreateMHTMLBodyFlagsContextOptional. Responsible for controlling whether objects in the email message are embedded or not. If this key is not set, objects in the email 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

For more information about the CreateMHTMLBody method and the CdoMHTMLFlags enumeration, see the Platform SDK in the MSDN Online Library at http://go.microsoft.com/fwlink/?LinkId=5161.

Values Written

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

KeyDescription
cdo_resultThe result code (an HRESULT) from the most recent CDO operation.
cdo_errorOptional. An error string from the most recent CDO operation, if any. NULL if there is no error.

Remarks

The ComposeDMLMessage 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 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 component uses the information gathered by the CreateUPMCookie component to create the cookie string.

The ComposeDMLMessage 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

AddAttachments

CreateUPMCookie

SendPrecomposedMessage

ThrottleDMLPerformance

VerifyMessageBody

VerifyRecipientData

Copyright © 2005 Microsoft Corporation.
All rights reserved.
Page view tracker