@sudoplatform/sudo-email

    Class DefaultSudoEmailClient

    Implements

    Index

    Constructors

    Methods

    • Delete a single email message identified by id.

      Parameters

      • id: string

        The identifier of the email message to be deleted.

      Returns Promise<undefined | DeleteEmailMessageSuccessResult>

      Result object containing the identifier of the email message that was deleted, or undefined if the email message could not be deleted.

      NotRegisteredError

      LimitExceededError

      ServiceError

    • Delete the email messages identified by the list of ids.

      Email messages can only be deleted in batches of 100. Anything greater will throw a LimitExceededError.

      Parameters

      • ids: string[]

        A list of one or more identifiers of the email messages to be deleted. There is a limit of 100 email message ids per API request. Exceeding this will cause an error to be thrown.

      Returns Promise<
          BatchOperationResult<
              DeleteEmailMessageSuccessResult,
              EmailMessageOperationFailureResult,
          >,
      >

      The status of the delete: Success - All email messages succeeded to delete. Partial - Only a partial amount of messages succeeded to delete. Includes a list of the identifiers of the email messages that failed and succeeded to delete. Failure - All email messages failed to delete.

      NotRegisteredError

      InvalidArgumentError

      LimitExceededError

      ServiceError

    • Delete all messages for in an email folder. Deletion will be processed asynchronously since it may take a substantial amount of time. This method does not wait for deletion to complete. To check for completion, listen for subscriptions or check list endpoints.

      Parameters

      Returns Promise<string>

      The id of the folder

    • Export the cryptographic keys to a key archive.

      Returns Promise<ArrayBuffer>

      Key archive data.

    • Get a list of all of the email domains for which end-to-end encryption is supported.

      Parameters

      • cachePolicy: CachePolicy

        Determines how the configured email domains will be fetched. Default usage is remoteOnly.

      Returns Promise<string[]>

      A list of all configured domains.

      NotRegisteredError

      ServiceError

    • Get a list of all of the email domains on which emails may be provisioned.

      Parameters

      • cachePolicy: CachePolicy

        Determines how the supported email domains will be fetched. Default usage is remoteOnly.

      Returns Promise<string[]>

      A list of supported domains.

      NotRegisteredError

      ServiceError

    • Imports cryptographic keys from a key archive.

      Parameters

      • archiveData: ArrayBuffer

        Key archive data to import the keys from.

      Returns Promise<void>

    • Lists the metadata of all draft email messages for the specified email address identifier.

      Parameters

      • emailAddressId: string

        The identifier of the email address associated with the draft email messages.

      Returns Promise<DraftEmailMessageMetadata[]>

      An array of draft email message metadata or an empty array if no matching draft email messages can be found.

    • Lists the metadata and content of all draft email messages for the user.

      Returns Promise<DraftEmailMessage[]>

      An array of draft email messages or an empty array if no matching draft email messages can be found.

    • Lists the metadata and content of all draft messages for the specified email address identifier.

      Parameters

      • emailAddressId: string

        The identifier of the email address associated with the draft email messages.

      Returns Promise<DraftEmailMessage[]>

      An array of draft email messages or an empty array if no matching draft email messages can be found.

    • Removes any cached data maintained by this client.

      Returns Promise<void>

    • Subscribe to email message events.

      Parameters

      • subscriptionId: string

        unique identifier to differentiate subscriptions; note that specifying a duplicate subscription id will replace the previous subscription.

      • subscriber: EmailMessageSubscriber

        implementation of callback to be invoked when email message event occurs

      Returns Promise<void>

    • Unsubscribe from email message events.

      Parameters

      • subscriptionId: string

        unique identifier to differentiate subscription

      Returns void

    MMNEPVFCICPMFPCPTTAAATR