-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemail-components.yml
More file actions
276 lines (267 loc) · 8.92 KB
/
Copy pathemail-components.yml
File metadata and controls
276 lines (267 loc) · 8.92 KB
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
openapi: 3.0.4
info:
title: Email API Components
version: 0.1.0
description: Entity schemas, request payloads, and path parameters for the Email API.
paths: {}
components:
parameters:
AccountId:
name: accountId
in: path
required: true
description: Identifies the tenant-scoped account configuration to use. The well-known value `default` selects the tenant's default account.
schema:
type: string
example: default
schemas:
EmailAddress:
type: object
description: An email participant. A bare address, optionally with a display name.
required: [address]
properties:
address:
type: string
format: email
description: RFC 5322 mailbox address.
example: alice@example.com
name:
type: string
nullable: true
description: Optional display name shown alongside the address.
example: Alice Smith
EmailStatus:
type: object
description: >-
Configuration and health of the email service for the calling tenant. The endpoint always
responds `200`; `configured` and `healthy` report whether a usable account is available
rather than being signalled through the HTTP status.
required: [configured, healthy]
properties:
configured:
type: boolean
description: True when the tenant has at least one usable account configuration.
healthy:
type: boolean
description: True when the service can reach its transport. Tracks `configured` for the SMTP transport.
defaultAccountId:
type: string
default: default
description: The account id used when a request omits `accountId`.
lastError:
type: string
nullable: true
description: The most recent configuration or connectivity error, when one is known.
EmailDelivery:
type: object
description: >-
Outcome of an accepted send. Returned with `202`; a send that the transport rejects is
reported as an error response, not as a `FAILED` body.
required: [status]
properties:
deliveryId:
type: string
nullable: true
description: Service-assigned id for the accepted message. Mirrors the provider message id for the SMTP transport.
providerMessageId:
type: string
nullable: true
description: The transport-assigned message id, such as the SMTP `Message-ID`.
transportId:
type: string
nullable: true
description: The id of the transport that delivered the message, for example `smtp`.
status:
type: string
enum: [SENT, FAILED, PENDING]
default: SENT
description: Delivery state. Accepted sends report `SENT`.
SmtpAccountFields:
type: object
description: >-
SMTP transport settings on an account write. `password` is write-only: it is handed to the
configured secret backend and never returned. The persisted reference is surfaced on reads
as `passwordSecretRef`.
required: [host, port]
properties:
host:
type: string
description: SMTP server hostname.
example: smtp.example.com
port:
type: integer
description: SMTP server port.
example: 587
username:
type: string
nullable: true
description: SMTP authentication username.
password:
type: string
writeOnly: true
nullable: true
description: >-
Plaintext SMTP password. Accepted only on writes and never echoed back. Requires a
configured secret backend; the request is refused otherwise.
useStartTls:
type: boolean
default: false
description: Upgrade the connection with STARTTLS.
useSsl:
type: boolean
default: false
description: Connect over implicit TLS.
SmtpResponseFields:
type: object
description: SMTP transport settings as returned on reads. Carries the secret reference, never the plaintext password.
required: [host, port]
properties:
host:
type: string
example: smtp.example.com
port:
type: integer
example: 587
username:
type: string
nullable: true
passwordSecretRef:
type: string
nullable: true
description: Opaque reference returned by the secret backend that stored the password. Resolved at transport construction time.
useStartTls:
type: boolean
default: false
useSsl:
type: boolean
default: false
EmailAccountWrite:
type: object
description: Account configuration accepted by the upsert endpoint.
required: [fromAddress]
properties:
transportId:
type: string
enum: [smtp]
default: smtp
description: The transport this account uses. SMTP is the only transport.
fromAddress:
type: string
format: email
description: Default sender address for messages sent through this account.
example: no-reply@example.com
fromName:
type: string
nullable: true
description: Default sender display name.
replyTo:
type: string
nullable: true
description: Default reply-to address.
smtp:
$ref: '#/components/schemas/SmtpAccountFields'
EmailAccount:
type: object
description: Account configuration as returned by the admin endpoints, with the password held behind a secret reference.
required: [accountId, transportId, fromAddress]
properties:
accountId:
type: string
example: default
transportId:
type: string
enum: [smtp]
fromAddress:
type: string
format: email
example: no-reply@example.com
fromName:
type: string
nullable: true
replyTo:
type: string
nullable: true
smtp:
$ref: '#/components/schemas/SmtpResponseFields'
SendEmailRequest:
type: object
description: A raw email. Provide an HTML body, a plain-text body, or both.
required: [to, subject]
properties:
to:
type: array
minItems: 1
description: Primary recipients.
items:
$ref: '#/components/schemas/EmailAddress'
subject:
type: string
example: Welcome to VDX
htmlBody:
type: string
nullable: true
description: HTML body.
textBody:
type: string
nullable: true
description: Plain-text body.
from:
$ref: '#/components/schemas/EmailAddress'
replyTo:
$ref: '#/components/schemas/EmailAddress'
cc:
type: array
description: Carbon-copy recipients.
items:
$ref: '#/components/schemas/EmailAddress'
bcc:
type: array
description: Blind carbon-copy recipients.
items:
$ref: '#/components/schemas/EmailAddress'
accountId:
type: string
default: default
description: Account configuration to send through. Defaults to the tenant's default account.
SendTemplatedEmailRequest:
type: object
description: A templated email. The body is rendered from a named template and a string context before delivery.
required: [to, subject, templateName]
properties:
to:
type: array
minItems: 1
description: Primary recipients.
items:
$ref: '#/components/schemas/EmailAddress'
subject:
type: string
example: Verify your tenant signup
templateName:
type: string
description: Name of the registered template to render.
example: tenant-signup-verification
templateContext:
type: object
additionalProperties:
type: string
description: Flat string-to-string context passed to the template renderer.
example:
displayName: Alice Smith
verificationLink: https://app.example.com/tenants/signup/confirm?token=abc
from:
$ref: '#/components/schemas/EmailAddress'
replyTo:
$ref: '#/components/schemas/EmailAddress'
cc:
type: array
items:
$ref: '#/components/schemas/EmailAddress'
bcc:
type: array
items:
$ref: '#/components/schemas/EmailAddress'
accountId:
type: string
default: default
description: Account configuration to send through. Defaults to the tenant's default account.