Abstract Protected ProviderReturns the name of this provider for use in error messages. Override in subclasses to provide a more descriptive name.
Archives a message. Override in subclasses that support this operation.
Parameters for archiving the message
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Abstract CreateCreates a draft message using the provider. Providers that don't support drafts should return Success: false with an appropriate error message.
Parameters for creating the draft
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Deletes a message. Override in subclasses that support this operation.
Parameters for deleting the message
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Downloads an attachment from a message. Override in subclasses that support this operation.
Parameters for downloading the attachment
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Abstract ForwardForwards a message to another client using the provider
Parameters for forwarding the message
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Abstract GetFetches messages using the provider
Parameters for fetching messages
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Gets a single message by ID. Override in subclasses that support this operation.
Parameters for retrieving the message
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Lists attachments on a message. Override in subclasses that support this operation.
Parameters for listing attachments
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Lists folders/mailboxes available in the provider. Override in subclasses that support this operation.
Parameters for listing folders
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Marks message(s) as read or unread. Override in subclasses that support this operation.
Parameters for marking messages
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Moves a message to a different folder. Override in subclasses that support this operation.
Parameters for moving the message
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Abstract ReplyReplies to a message using the provider
Parameters for replying to the message
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Searches messages using a query string. Override in subclasses that support this operation.
Parameters for searching messages
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Abstract SendSends a single message using the provider
The processed message to send
Optional credentials: ProviderCredentialsBaseOptional credentials override for this request. Provider-specific credential interface (e.g., SendGridCredentials). If not provided, uses environment variables.
Promise
Returns the list of operations supported by this provider. Override in subclasses to accurately reflect capabilities. Default implementation returns only the core abstract methods.
Checks if this provider supports a specific operation.
The operation to check
true if the operation is supported
Base class for all communication providers. Each provider sub-classes this base class and implements functionality specific to the provider.
Remarks
All methods accept an optional
credentialsparameter that allows per-request credential overrides. When credentials are provided, they take precedence over environment variables. Setcredentials.disableEnvironmentFallback = trueto disable environment variable fallback.Each provider defines its own credential interface that extends
ProviderCredentialsBase. For example,SendGridCredentials,MSGraphCredentials, etc.Example