mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-05-29 15:44:31 +00:00
Merge pull request #19687 from qhoekman/master
[nodemailer-mailgun-transport] Added a new interface Options which includes AuthOptions
This commit is contained in:
@@ -6,12 +6,15 @@
|
||||
import * as nodemailer from 'nodemailer';
|
||||
|
||||
declare namespace mailgunTransport {
|
||||
interface Options {
|
||||
auth: AuthOptions;
|
||||
}
|
||||
interface AuthOptions {
|
||||
api_key: string;
|
||||
domain?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare function mailgunTransport(options: mailgunTransport.AuthOptions): nodemailer.Transport;
|
||||
declare function mailgunTransport(options: mailgunTransport.Options): nodemailer.Transport;
|
||||
|
||||
export = mailgunTransport;
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import mailgunTransport = require('nodemailer-mailgun-transport');
|
||||
import nodemailer = require('nodemailer');
|
||||
|
||||
const opts: mailgunTransport.AuthOptions = {
|
||||
api_key: "harry"
|
||||
const opts: mailgunTransport.Options = {
|
||||
auth: {
|
||||
api_key: "harry"
|
||||
}
|
||||
};
|
||||
|
||||
const optsWithDomain: mailgunTransport.AuthOptions = {
|
||||
api_key: "harry",
|
||||
domain: "http://www.foo.com"
|
||||
const optsWithDomain: mailgunTransport.Options = {
|
||||
auth: {
|
||||
api_key: "harry",
|
||||
domain: "http://www.foo.com"
|
||||
}
|
||||
};
|
||||
|
||||
const transport: nodemailer.Transporter = nodemailer.createTransport(mailgunTransport(optsWithDomain));
|
||||
|
||||
Reference in New Issue
Block a user