Member Junction
    Preparing search index...

    Message class, holds information and functionality specific to a single message

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    BCCRecipients?: string[]

    Recipients to send a copy of the message to without revealing their email addresses to the other recipients, typically an email address

    Body?: string

    The body of the message, used if BodyTemplate is not provided.

    Optional, when provided, Body is ignored and the template is used to render the message. In addition, if BodyTemplate is provided it will be used to render the Body and if the template has HTML content it will also be used to render the HTMLBody

    CCRecipients?: string[]

    Recipients to send a copy of the message to, typically an email address

    ContextData?: any

    Optional, any context data that is needed to render the message template

    DryRun?: boolean

    Optional. When true, the send is a DRY RUN: the engine and the provider execute their FULL pipeline — validation, credential resolution, addressing, template resolution/rendering and provider-specific payload construction — but the provider MUST NOT contact its external service (no email/SMS/push/API call leaves the process). The operation returns success with the result's DryRun flag set to true so callers can distinguish a rehearsed send from a real one, and the Communication Log written for the send carries a DryRun: true marker in its MessageContent JSON.

    Distinct from the engine's previewOnly parameter: previewOnly stops right after template processing (the provider is never invoked and no Communication Log is written), while DryRun exercises the provider's preflight + payload construction AND the audit-log lifecycle, stopping only at the external transport boundary.

    From: string

    The sender of the message, typically an email address but can be anything that is provider-specific for example for a provider that is a social media provider, it might be a user's social media handle

    FromName?: string

    The name of the sender, typically the display name of the email address

    Headers?: Record<string, string>

    Optional, any headers to add to the message

    HTMLBody?: string

    The HTML body of the message

    HTMLBodyTemplate?: MJTemplateEntityExtended

    Optional, when provided, HTMLBody is ignored and the template is used to render the message. This OVERRIDES the BodyTemplate's HTML content even if BodyTemplate is provided. This allows for flexibility in that you can specify a completely different HTMLBodyTemplate and not just relay on the TemplateContent of the BodyTemplate having an HTML option.

    The type of message to send

    SendAt?: Date

    The date and time to send the message, if not provided the message will be sent immediately

    Subject?: string

    The subject line for the message, used if SubjectTemplate is not provided and only supported by some providers

    SubjectTemplate?: MJTemplateEntityExtended

    Optional, when provided, Subject is ignored and the template is used to render the message

    To: string

    The recipient of the message, typically an email address but can be anything that is provider-specific for example for a provider that is a social media provider, it might be a user's social media handle