Minimum Version Required: 22.01
Pre-Conditions
This routine only supports "Add Only" import action
The source report for this import must contain a "SingleSendMD5" field mapped to prevent duplicate messages
User must have appropriate permissions to send messages
For email delivery, valid email addresses are required
For text message and eChat delivery, valid user IDs are required
Message content must be provided either in the Body field directly or through a document reference
Steps
The HTMLMessages EDBL routine allows you to import and send messages through multiple delivery channels (email, text, or eChat). The routine:
Validates all recipient and sender information
Processes message templates with field replacements
Prevents duplicate messages using a unique identifier (SingleSendMD5)
Transforms API calls and QuickLinks within the message content
Automatically adds unsubscribe links to alert-based emails
Sends messages immediately or schedules them for later delivery
Tracks message delivery status
The routine will disable sending for invalid messages and include warnings in the import results. For performance reasons, if more than 200 messages are imported at once, they will be queued rather than sent immediately.
Special formatting options are available within the Body field:
<APICall>Display Text^APICommand^Parameters</APICall> will generate a clickable link
<QuickLink>Link Text^URL</QuickLink> will generate a tracked link
For text messages, <br> tags will be converted to new lines
Fields And Definitions
DeliveryMethod: Specifies the channel for message delivery. Values include: "Email" (2), "Text Message" (3), "eChat" (1), or "TestDoNotSend" (0).
FromUserID: The system user ID of the sender. Required for eChat and text messages unless AlertID is provided.
FromEmail: The sender's email address. Required for email delivery.
ToUserID: The system user ID of the recipient. Required for eChat and text messages.
ToEmail: The recipient's email address. Required for email delivery.
Subject: Message subject line. Required for email, optional for other delivery methods.
Body: The actual message content. HTML is supported for email, plain text for other methods.
BodyHTMLDocumentID: Reference to a document in the system containing the message template. Used when Body is not directly provided.
BodyHTMLGlobalDocumentID: Reference to a global document containing the message template. Used when Body and BodyHTMLDocumentID are not provided.
DelayedSendTime: Schedule messages for future delivery. If not specified, messages are sent immediately.
SingleSendMD5: Unique identifier to prevent duplicate sending. This must be mapped from your source report.
AlertID: If the message is associated with a system alert, this field links them. Also enables automatic unsubscribe links.
ImportTaskID: Reference to the import task that created this message.
SendDisable: Set to 1 to prevent sending. Defaults to 0 (send).
Best Practices
Always include the SingleSendMD5 field to prevent duplicate messages
Provide both email and user ID fields when possible for better matching
Test your message templates with a small sample using DeliveryMethod = "TestDoNotSend" before mass sending
Use placeholders like {FieldName} in your templates for personalization
For large message volumes, use a scheduled import with DelayedSendTime to spread out delivery
Consider using QuickLinks for tracking click-through rates in marketing campaigns
Ensure email templates comply with anti-spam regulations by including unsubscribe options
Validate all email addresses and user IDs before import to avoid failed deliveries
For text messages, keep content brief and use only essential formatting
If reusing templates, store them as HTML documents and reference them by BodyHTMLDocumentID