Sendim
A simple library to send email cross providers.
Usage
import { Sendim } from 'sendim';
const sendim = new Sendim();
await sendim.addTransport<SendimSampleProviderConfig>(SendimSampleProvider, {});
await sendim.sendTransactionalMail({
templateId: 'test',
to: [{
email: 'test@test.fr'
}],
sender: {
email: 'test@test.fr'
}
});
addTransport(sendimProvider, config?)
Add transport to sendim
Params
Field Name | Type | Default | Description |
---|
sendimProvider | Class implements SendimTransportInterface | required | Provider to use |
config | object | {} | Config for provider |
sendRawEmail(options)
Send raw email
Params
Field Name | Type | Default | Description |
---|
options | RawMailOptions | required | options to send email |
sendTransactionalEmail(options)
Send transactional email
Params
Field Name | Type | Default | Description |
---|
options | TransactionalMailOptions | required | options to send email |
Tests
To execute jest tests (all errors, type integrity test)
pnpm test
Maintain
This package use TSdx. Please check documentation to update this package.