-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemails.ts
183 lines (146 loc) · 3.59 KB
/
emails.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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
/**
* Val Town supports sending emails from vals
*/
export class Emails extends APIResource {
/**
* Send emails
*/
send(body?: EmailSendParams, options?: Core.RequestOptions): Core.APIPromise<EmailSendResponse>;
send(options?: Core.RequestOptions): Core.APIPromise<EmailSendResponse>;
send(
body: EmailSendParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<EmailSendResponse> {
if (isRequestOptions(body)) {
return this.send({}, body);
}
return this._client.post('/v1/email', { body, ...options });
}
}
/**
* Successfully sent email
*/
export interface EmailSendResponse {
message: string;
}
export interface EmailSendParams {
/**
* A list of attachments to add to the email
*/
attachments?: Array<EmailSendParams.Attachment>;
/**
* A single email or list of emails for one of the address fields
*/
bcc?: string | EmailSendParams.EmailNameAndAddress | Array<string | EmailSendParams.EmailNameAndAddress>;
/**
* A single email or list of emails for one of the address fields
*/
cc?: string | EmailSendParams.EmailNameAndAddress | Array<string | EmailSendParams.EmailNameAndAddress>;
/**
* An email address and name
*/
from?: string | EmailSendParams.EmailNameAndAddress;
/**
* A set of headers to include the email that you send
*/
headers?: Record<string, string>;
/**
* HTML content of the email. Can be specified alongside text
*/
html?: string;
/**
* A reply-to list of email addresses
*/
replyToList?: EmailSendParams.EmailNameAndAddress | Array<EmailSendParams.EmailList>;
/**
* The subject line of the email
*/
subject?: string;
/**
* Text content of the email, for email clients that may not support HTML
*/
text?: string;
/**
* A single email or list of emails for one of the address fields
*/
to?: string | EmailSendParams.EmailNameAndAddress | Array<string | EmailSendParams.EmailNameAndAddress>;
}
export namespace EmailSendParams {
export interface Attachment {
content: string;
filename: string;
contentId?: string;
disposition?: string;
type?: string;
}
/**
* An email address and name
*/
export interface EmailNameAndAddress {
email: string;
name?: string;
}
/**
* An email address and name
*/
export interface EmailNameAndAddress {
email: string;
name?: string;
}
/**
* An email address and name
*/
export interface EmailNameAndAddress {
email: string;
name?: string;
}
/**
* An email address and name
*/
export interface EmailNameAndAddress {
email: string;
name?: string;
}
/**
* An email address and name
*/
export interface EmailNameAndAddress {
email: string;
name?: string;
}
/**
* An email address and name
*/
export interface EmailNameAndAddress {
email: string;
name?: string;
}
/**
* An email address and name
*/
export interface EmailList {
email: string;
name?: string;
}
/**
* An email address and name
*/
export interface EmailNameAndAddress {
email: string;
name?: string;
}
/**
* An email address and name
*/
export interface EmailNameAndAddress {
email: string;
name?: string;
}
}
export declare namespace Emails {
export { type EmailSendResponse as EmailSendResponse, type EmailSendParams as EmailSendParams };
}