ultimail-provider-postmark
v0.0.5
Published
Provider middleware for Ultimail that adds support for sending emails via Postmark.
Downloads
11
Maintainers
Readme
Ultimail-Provider-Postmark
Provider middleware for Ultimail that adds support for sending emails via Postmark.
Quick Start
You need to configure this middleware as an Ultimail "provider" using the mailer.configure()
method:
const Ultimail = require(`ultimail`);
const ultimailProviderPostmark = require(`ultimail-provider-postmark`);
const mailer = new Ultimail({
from: `[email protected]`,
styles: true,
});
mailer.configure(`provider`, ultimailProviderPostmark({
apiKey: `my-postmark-server-api-key`,
}));
Configuration
You can pass the following config options to this middleware:
| Option | Default Value | Description |
|----------------|---------------|-------------|
| apiKey | | The API server key that Postmark assigns to your server. |
| throwOnFailure | true
| Set false to just return the Postmark response when an email fails to send, instead of throwing an error. |
Response Object
The shape of the response object returned by Postmark can be found in the Postmark API documentation. If you want to get access to the response object even when an email fails to send (instead of an error being thrown), you will need to set the "throwOnFailure" config option to a falsy value.