-
Notifications
You must be signed in to change notification settings - Fork 779
/
Copy pathmail.d.ts
50 lines (41 loc) · 1.32 KB
/
mail.d.ts
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
import {Client} from "@sendgrid/client";
import {ClientResponse} from "@sendgrid/client/src/response";
import {ResponseError} from "@sendgrid/helpers/classes";
import {MailDataRequired} from "@sendgrid/helpers/classes/mail";
declare class MailService {
/**
* SendGrid API key passthrough for convenience.
*/
setApiKey(apiKey: string): void;
/**
* Client to use for invoking underlying API
*/
setClient(client: Client): void;
/**
* Twilio Email Auth passthrough for convenience.
*/
setTwilioEmailAuth(username: string, password: string): void;
/**
* Set the default request timeout (in milliseconds).
*/
setTimeout(timeout: number): void;
/**
* Set substitution wrappers
*/
setSubstitutionWrappers(left: string, right: string): void;
/**
* Send email
*/
send(data: MailDataRequired | MailDataRequired[], isMultiple?: boolean, cb?: (err: Error | ResponseError, result: [ClientResponse, {}]) => void): Promise<[ClientResponse, {}]>;
/**
* Send multiple emails (shortcut)
*/
sendMultiple(data: MailDataRequired, cb?: (error: Error | ResponseError, result: [ClientResponse, {}]) => void): Promise<[ClientResponse, {}]>;
}
declare const mail: MailService;
// @ts-ignore
export = mail;
export {MailService};
export {MailDataRequired};
export {ClientResponse};
export {ResponseError};