api: lowercase smtp namespace export

This commit is contained in:
Zack Schuster 2020-05-01 13:17:50 -07:00
parent 962e3b0c3f
commit efe9daa535
3 changed files with 8 additions and 17 deletions

View File

@ -72,7 +72,7 @@ client.send(message, function(err, message) { console.log(err || message); });
// you can continue to send more messages with successive calls to 'client.send',
// they will be queued on the same smtp connection
// or instead of using the built-in client you can create an instance of 'SMTP.SMTPConnection'
// or instead of using the built-in client you can create an instance of 'smtp.SMTPConnection'
```
## EXAMPLE USAGE - sending through outlook
@ -213,7 +213,7 @@ client.send(message, (err, message) => {
related // an array of attachments that you want to be related to the parent attachment
}
## new SMTP.SMTPConnection(options)
## new smtp.SMTPConnection(options)
// options is an object with the following keys
options =
@ -230,7 +230,7 @@ client.send(message, (err, message) => {
logger // override the built-in logger (useful for e.g. Azure Function Apps, where console.log doesn't work)
}
## SMTP.SMTPConnection#authentication
## smtp.SMTPConnection#authentication
associative array of currently supported SMTP authentication mechanisms

View File

@ -1,5 +1,5 @@
export * as client from './smtp/client';
export * as message from './smtp/message';
export * as date from './smtp/date';
export * as SMTP from './smtp/smtp';
export * as smtp from './smtp/smtp';
export * as error from './smtp/error';

View File

@ -1,6 +1,6 @@
import test from 'ava';
import { client as c, message as m, SMTP } from '../email';
import { client as c, message as m, smtp as s } from '../email';
test.cb(
'connecting to wrong email server should not invoke callback multiple times',
@ -27,20 +27,11 @@ test('should have a default timeout', async (t) => {
port: 1234,
timeout: undefined as number | null | undefined,
};
t.deepEqual(
new c.Client(connectionOptions).smtp.timeout,
SMTP.DEFAULT_TIMEOUT
);
t.deepEqual(new c.Client(connectionOptions).smtp.timeout, s.DEFAULT_TIMEOUT);
connectionOptions.timeout = null;
t.deepEqual(
new c.Client(connectionOptions).smtp.timeout,
SMTP.DEFAULT_TIMEOUT
);
t.deepEqual(new c.Client(connectionOptions).smtp.timeout, s.DEFAULT_TIMEOUT);
connectionOptions.timeout = undefined;
t.deepEqual(
new c.Client(connectionOptions).smtp.timeout,
SMTP.DEFAULT_TIMEOUT
);
t.deepEqual(new c.Client(connectionOptions).smtp.timeout, s.DEFAULT_TIMEOUT);
});