-
Notifications
You must be signed in to change notification settings - Fork 151
/
Copy pathprovider-email.js
90 lines (89 loc) · 2.44 KB
/
provider-email.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* @flow */
import type { EmailRequestType } from './notification-request'
// TODO?: provider APIs (SES, sendinblue, mailjet, mandrill, elasticemail...)
export type EmailProviderType = {
type: 'logger'
} | {
type: 'custom',
id: string,
send: (EmailRequestType) => Promise<string>
} | {
// Doc: https://nodemailer.com/transports/sendmail/
type: 'sendmail',
sendmail: true,
path: string, // Defaults to 'sendmail'
newline: 'windows' | 'unix', // Defaults to 'unix'
args?: string[],
attachDataUrls?: boolean,
disableFileAccess?: boolean,
disableUrlAccess?: boolean
} | {
// General options (Doc: https://nodemailer.com/smtp/)
type: 'smtp',
port?: 25 | 465 | 587, // Defaults to 587
host?: string, // Defaults to 'localhost'
auth: {
type?: 'login',
user: string,
pass: string
} | {
type: 'oauth2', // Doc: https://nodemailer.com/smtp/oauth2/#oauth-3lo
user: string,
clientId?: string,
clientSecret?: string,
refreshToken?: string,
accessToken?: string,
expires?: string,
accessUrl?: string
} | {
type: 'oauth2', // Doc: https://nodemailer.com/smtp/oauth2/#oauth-2lo
user: string,
serviceClient: string,
privateKey?: string
},
authMethod?: string, // Defaults to 'PLAIN'
// TLS options (Doc: https://nodemailer.com/smtp/#tls-options)
secure?: boolean,
tls?: Object, // Doc: https://nodejs.org/api/tls.html#tls_class_tls_tlssocket
ignoreTLS?: boolean,
requireTLS?: boolean,
// Connection options (Doc: https://nodemailer.com/smtp/#connection-options)
name?: string,
localAddress?: string,
connectionTimeout?: number,
greetingTimeout?: number,
socketTimeout?: number,
// Debug options (Doc: https://nodemailer.com/smtp/#debug-options)
logger?: boolean,
debug?: boolean,
// Security options (Doc: https://nodemailer.com/smtp/#security-options)
disableFileAccess?: boolean,
disableUrlAccess?: boolean,
// Pooling options (Doc: https://nodemailer.com/smtp/pooled/)
pool?: boolean,
maxConnections?: number,
maxMessages?: number,
rateDelta?: number,
rateLimit?: number,
// Proxy options (Doc: https://nodemailer.com/smtp/proxies/)
proxy?: string
} | {
type: 'mailgun',
apiKey: string,
domainName: string
} | {
type: 'mandrill',
apiKey: string
} | {
type: 'sendgrid',
apiKey: string
} | {
type: 'ses',
region: string,
accessKeyId: string,
secretAccessKey: string,
sessionToken?: ?string
} | {
type: 'sparkpost',
apiKey: string
}