ProtectedconstructorTrue once the underlying CommunicationEngineBase cache has loaded.
StaticInstanceEnsures the single CommunicationEngineBase cache is loaded. Delegates entirely to the base.
OptionalcontextUser: UserInfoOptionalprovider: IMetadataProviderCreates a draft message using the specified provider
The message to save as a draft
Name of the provider to use
OptionalcontextUser: UserInfoOptional user context for server-side operations
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request.
Provider-specific credential object (e.g., MSGraphCredentials).
If not provided, uses environment variables.
Set credentials.disableEnvironmentFallback = true to require explicit credentials.
Promise
The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.
Gets an instance of the class for the specified provider. The provider must be one of the providers that are configured in the system.
Sends multiple messages using the specified provider. The provider must be one of the providers that are configured in the system.
Name of the communication provider to use
Type of message to send
Base message (To will be replaced with each recipient). Set
message.DryRun = true for a DRY RUN: every per-recipient copy keeps the
flag, so the full pipeline (run + per-message audit log lifecycle, template
processing, provider payload construction) executes but no provider contacts
its external service; each MessageResult comes back with DryRun: true and
the Communication Log rows carry a DryRun: true marker in MessageContent.
Array of recipients to send to
If true, only preview without sending (stops BEFORE the provider and
writes no Communication Log — see Message.DryRun for the deeper
no-external-send rehearsal that still exercises provider + audit)
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request.
Provider-specific credential object (e.g., SendGridCredentials).
If not provided, uses environment variables.
Set credentials.disableEnvironmentFallback = true to require explicit credentials.
Sends a single message using the specified provider. The provider must be one of the providers that are configured in the system.
Name of the communication provider to use
Type of message to send
The message to send. Set message.DryRun = true for a DRY RUN: the message
is processed, the Communication Log is written (marked DryRun: true in its
MessageContent), and the provider constructs its full payload — but never
contacts its external service; the returned MessageResult has DryRun: true.
Optionalrun: MJCommunicationRunEntityOptional communication run entity for logging
OptionalpreviewOnly: booleanIf true, only preview without sending (stops BEFORE the provider and
writes no Communication Log — see Message.DryRun for the deeper
no-external-send rehearsal that still exercises provider + audit)
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request.
Provider-specific credential object (e.g., SendGridCredentials).
If not provided, uses environment variables.
Set credentials.disableEnvironmentFallback = true to require explicit credentials.
Protected StaticgetReturns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.
OptionalclassName: string
Base class for communications. This class can be sub-classed if desired if you would like to modify the logic across ALL actions. To do so, sub-class this class and use the
Register Class
decorator from the @memberjunction/global package to register your sub-class with the ClassFactory. This will cause your sub-class to be used instead of this base class when the Metadata object insantiates the ActionEngine.