Class: DomainClient

Client class that can be used to interact with an OhMySMTP Domain

Hierarchy#

  • BaseClient

    DomainClient

Constructors#

constructor#

+ new DomainClient(domainToken: string, configOptions?: Configuration): DomainClient

Create a client for sending emails from a domain

Parameters:#

NameTypeDescription
domainTokenstringThe API token for the domain
configOptions?ConfigurationConfiguration options for accessing the API

Returns: DomainClient

Defined in: DomainClient.ts:10

Properties#

clientVersion#

Readonly clientVersion: string

Defined in: BaseClient.ts:22


errorHandler#

Protected Readonly errorHandler: ErrorHandler

Defined in: BaseClient.ts:24


httpClient#

Readonly httpClient: AxiosInstance

Defined in: BaseClient.ts:23


DefaultOptions#

Readonly Static DefaultOptions: Configuration

Default options

Defined in: BaseClient.ts:17

Methods#

getOptions#

getOptions(): Configuration

Returns: Configuration

Defined in: BaseClient.ts:42


prepareHeaders#

prepareHeaders(): object

Prepare the default HTTP Request Headers

Returns: object

Defined in: BaseClient.ts:49


processRequestWithBody#

ProtectedprocessRequestWithBody<T>(method: POST, path: string, body: object, callback?: Callback<T>): Promise<T>

Prepare the request and send on

see processRequest for more details.

Type parameters:#

Name
T

Parameters:#

NameType
methodPOST
pathstring
bodyobject
callback?Callback<T>

Returns: Promise<T>

Defined in: BaseClient.ts:63


sendEmail#

sendEmail(email: Message, callback?: Callback<SendResponse>): Promise<SendResponse>

Send a single email message through the API

Parameters:#

NameTypeDescription
emailMessage-
callback?Callback<SendResponse>A callback that if provided will be called after sending the email is complete

Returns: Promise<SendResponse>

A promise that will resolve when the API responds (or an error occurs)

Defined in: DomainClient.ts:27