@bernierllc/email-sender 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +430 -0
- package/dist/core/email-sender.d.ts +71 -0
- package/dist/core/email-sender.d.ts.map +1 -0
- package/dist/core/email-sender.js +125 -0
- package/dist/core/email-sender.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/base.d.ts +63 -0
- package/dist/providers/base.d.ts.map +1 -0
- package/dist/providers/base.js +132 -0
- package/dist/providers/base.js.map +1 -0
- package/dist/providers/mailgun.d.ts +40 -0
- package/dist/providers/mailgun.d.ts.map +1 -0
- package/dist/providers/mailgun.js +525 -0
- package/dist/providers/mailgun.js.map +1 -0
- package/dist/providers/postmark.d.ts +37 -0
- package/dist/providers/postmark.d.ts.map +1 -0
- package/dist/providers/postmark.js +482 -0
- package/dist/providers/postmark.js.map +1 -0
- package/dist/providers/sendgrid.d.ts +80 -0
- package/dist/providers/sendgrid.d.ts.map +1 -0
- package/dist/providers/sendgrid.js +407 -0
- package/dist/providers/sendgrid.js.map +1 -0
- package/dist/providers/ses.d.ts +38 -0
- package/dist/providers/ses.d.ts.map +1 -0
- package/dist/providers/ses.js +404 -0
- package/dist/providers/ses.js.map +1 -0
- package/dist/providers/smtp.d.ts +61 -0
- package/dist/providers/smtp.d.ts.map +1 -0
- package/dist/providers/smtp.js +201 -0
- package/dist/providers/smtp.js.map +1 -0
- package/dist/types/index.d.ts +99 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SendGridProvider = void 0;
|
|
11
|
+
/**
|
|
12
|
+
* SendGrid Email Provider implementation
|
|
13
|
+
*/
|
|
14
|
+
const base_1 = require("./base");
|
|
15
|
+
class SendGridProvider extends base_1.EmailProvider {
|
|
16
|
+
constructor(config) {
|
|
17
|
+
super(config);
|
|
18
|
+
this.baseUrl = 'https://api.sendgrid.com/v3';
|
|
19
|
+
if (this.config.provider !== 'sendgrid') {
|
|
20
|
+
throw new Error('SendGridProvider requires provider to be "sendgrid"');
|
|
21
|
+
}
|
|
22
|
+
this.apiKey = this.config.apiKey || '';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Send a single email
|
|
26
|
+
*/
|
|
27
|
+
async sendEmail(email) {
|
|
28
|
+
try {
|
|
29
|
+
// Validate email message
|
|
30
|
+
const validation = this.validateEmailMessage(email);
|
|
31
|
+
if (!validation.isValid) {
|
|
32
|
+
return {
|
|
33
|
+
success: false,
|
|
34
|
+
errorMessage: `Email validation failed: ${validation.errors.join(', ')}`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Prepare SendGrid mail data
|
|
38
|
+
const toRecipient = { email: email.toEmail };
|
|
39
|
+
if (email.toName) {
|
|
40
|
+
toRecipient.name = email.toName;
|
|
41
|
+
}
|
|
42
|
+
const fromAddress = {
|
|
43
|
+
email: email.fromEmail || this.config.fromEmail,
|
|
44
|
+
};
|
|
45
|
+
if (email.fromName) {
|
|
46
|
+
fromAddress.name = email.fromName;
|
|
47
|
+
}
|
|
48
|
+
else if (this.config.fromName) {
|
|
49
|
+
fromAddress.name = this.config.fromName;
|
|
50
|
+
}
|
|
51
|
+
const mailData = {
|
|
52
|
+
to: [toRecipient],
|
|
53
|
+
from: fromAddress,
|
|
54
|
+
subject: email.subject,
|
|
55
|
+
content: [],
|
|
56
|
+
};
|
|
57
|
+
// Add content
|
|
58
|
+
if (email.htmlContent) {
|
|
59
|
+
mailData.content.push({
|
|
60
|
+
type: 'text/html',
|
|
61
|
+
value: email.htmlContent,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (email.textContent) {
|
|
65
|
+
mailData.content.push({
|
|
66
|
+
type: 'text/plain',
|
|
67
|
+
value: email.textContent,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// Add reply-to
|
|
71
|
+
if (email.replyTo) {
|
|
72
|
+
mailData.reply_to = { email: email.replyTo };
|
|
73
|
+
}
|
|
74
|
+
// Add headers
|
|
75
|
+
if (email.headers) {
|
|
76
|
+
mailData.headers = email.headers;
|
|
77
|
+
}
|
|
78
|
+
// Add attachments
|
|
79
|
+
if (email.attachments && email.attachments.length > 0) {
|
|
80
|
+
mailData.attachments = email.attachments.map(attachment => {
|
|
81
|
+
const sendGridAttachment = {
|
|
82
|
+
content: attachment.content,
|
|
83
|
+
filename: attachment.filename,
|
|
84
|
+
};
|
|
85
|
+
if (attachment.contentType) {
|
|
86
|
+
sendGridAttachment.type = attachment.contentType;
|
|
87
|
+
}
|
|
88
|
+
if (attachment.disposition) {
|
|
89
|
+
sendGridAttachment.disposition = attachment.disposition;
|
|
90
|
+
}
|
|
91
|
+
return sendGridAttachment;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
// Send email via SendGrid API
|
|
95
|
+
const response = await this.makeApiRequest('/mail/send', {
|
|
96
|
+
method: 'POST',
|
|
97
|
+
body: JSON.stringify(mailData),
|
|
98
|
+
});
|
|
99
|
+
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
100
|
+
const responseBody = JSON.parse(response.body);
|
|
101
|
+
return {
|
|
102
|
+
success: true,
|
|
103
|
+
messageId: responseBody.id || this.generateMessageId(),
|
|
104
|
+
providerResponse: responseBody,
|
|
105
|
+
metadata: {
|
|
106
|
+
statusCode: response.statusCode,
|
|
107
|
+
headers: response.headers,
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
const errorBody = JSON.parse(response.body);
|
|
113
|
+
return {
|
|
114
|
+
success: false,
|
|
115
|
+
errorMessage: errorBody.errors?.[0]?.message || `HTTP ${response.statusCode}`,
|
|
116
|
+
providerResponse: errorBody,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
return {
|
|
122
|
+
success: false,
|
|
123
|
+
errorMessage: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
124
|
+
providerResponse: error,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Send multiple emails
|
|
130
|
+
*/
|
|
131
|
+
async sendBatch(emails) {
|
|
132
|
+
const results = [];
|
|
133
|
+
for (const email of emails) {
|
|
134
|
+
const result = await this.sendEmail(email);
|
|
135
|
+
results.push(result);
|
|
136
|
+
}
|
|
137
|
+
return results;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get delivery status for a message
|
|
141
|
+
*/
|
|
142
|
+
async getDeliveryStatus(messageId) {
|
|
143
|
+
try {
|
|
144
|
+
const response = await this.makeApiRequest(`/messages/${messageId}`, {
|
|
145
|
+
method: 'GET',
|
|
146
|
+
});
|
|
147
|
+
if (response.statusCode === 200) {
|
|
148
|
+
const data = JSON.parse(response.body);
|
|
149
|
+
const deliveryStatus = {
|
|
150
|
+
messageId,
|
|
151
|
+
status: this.mapSendGridStatus(data.status),
|
|
152
|
+
metadata: data,
|
|
153
|
+
};
|
|
154
|
+
if (data.delivered_at) {
|
|
155
|
+
deliveryStatus.deliveredAt = new Date(data.delivered_at);
|
|
156
|
+
}
|
|
157
|
+
if (data.opened_at) {
|
|
158
|
+
deliveryStatus.openedAt = new Date(data.opened_at);
|
|
159
|
+
}
|
|
160
|
+
if (data.clicked_at) {
|
|
161
|
+
deliveryStatus.clickedAt = new Date(data.clicked_at);
|
|
162
|
+
}
|
|
163
|
+
if (data.bounced_at) {
|
|
164
|
+
deliveryStatus.bouncedAt = new Date(data.bounced_at);
|
|
165
|
+
}
|
|
166
|
+
if (data.reason) {
|
|
167
|
+
deliveryStatus.reason = data.reason;
|
|
168
|
+
}
|
|
169
|
+
return deliveryStatus;
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Process webhook events from SendGrid
|
|
179
|
+
*/
|
|
180
|
+
async processWebhook(payload, signature) {
|
|
181
|
+
try {
|
|
182
|
+
// Verify webhook signature if secret is provided
|
|
183
|
+
if (this.config.webhookSecret) {
|
|
184
|
+
const isValid = this.verifyWebhookSignature(payload, signature);
|
|
185
|
+
if (!isValid) {
|
|
186
|
+
throw new Error('Invalid webhook signature');
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const events = [];
|
|
190
|
+
// SendGrid webhooks can be single event or array of events
|
|
191
|
+
const webhookEvents = Array.isArray(payload) ? payload : [payload];
|
|
192
|
+
for (const event of webhookEvents) {
|
|
193
|
+
events.push({
|
|
194
|
+
messageId: event.sg_message_id,
|
|
195
|
+
eventType: event.event,
|
|
196
|
+
timestamp: new Date(event.timestamp * 1000),
|
|
197
|
+
email: event.email,
|
|
198
|
+
reason: event.reason,
|
|
199
|
+
response: event.response,
|
|
200
|
+
metadata: event,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
return events;
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
throw new Error(`Failed to process webhook: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Override capabilities for SendGrid
|
|
211
|
+
*/
|
|
212
|
+
getCapabilities() {
|
|
213
|
+
return {
|
|
214
|
+
supportsBatch: true,
|
|
215
|
+
supportsTemplates: true,
|
|
216
|
+
supportsWebhooks: true,
|
|
217
|
+
supportsAttachments: true,
|
|
218
|
+
supportsDeliveryTracking: true,
|
|
219
|
+
maxBatchSize: 1000,
|
|
220
|
+
maxAttachmentSize: 30 * 1024 * 1024, // 30MB
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Create a template in SendGrid
|
|
225
|
+
*/
|
|
226
|
+
async createTemplate(templateData) {
|
|
227
|
+
try {
|
|
228
|
+
const response = await this.makeApiRequest('/templates', {
|
|
229
|
+
method: 'POST',
|
|
230
|
+
body: JSON.stringify({
|
|
231
|
+
name: templateData.name,
|
|
232
|
+
generation: 'dynamic',
|
|
233
|
+
}),
|
|
234
|
+
});
|
|
235
|
+
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
236
|
+
const data = JSON.parse(response.body);
|
|
237
|
+
const templateId = data.id;
|
|
238
|
+
// Create the template version
|
|
239
|
+
await this.makeApiRequest(`/templates/${templateId}/versions`, {
|
|
240
|
+
method: 'POST',
|
|
241
|
+
body: JSON.stringify({
|
|
242
|
+
name: 'version_1',
|
|
243
|
+
subject: templateData.subject,
|
|
244
|
+
html_content: templateData.htmlContent,
|
|
245
|
+
plain_content: templateData.textContent,
|
|
246
|
+
active: 1,
|
|
247
|
+
}),
|
|
248
|
+
});
|
|
249
|
+
return templateId;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
throw new Error(`Failed to create template: ${response.statusCode}`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
throw new Error(`Failed to create template: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Send an email using a SendGrid template
|
|
261
|
+
*/
|
|
262
|
+
async sendTemplateEmail(templateId, toEmail, templateData, toName) {
|
|
263
|
+
try {
|
|
264
|
+
const toRecipient = { email: toEmail };
|
|
265
|
+
if (toName) {
|
|
266
|
+
toRecipient.name = toName;
|
|
267
|
+
}
|
|
268
|
+
const fromAddress = {
|
|
269
|
+
email: this.config.fromEmail,
|
|
270
|
+
};
|
|
271
|
+
if (this.config.fromName) {
|
|
272
|
+
fromAddress.name = this.config.fromName;
|
|
273
|
+
}
|
|
274
|
+
const mailData = {
|
|
275
|
+
to: [toRecipient],
|
|
276
|
+
from: fromAddress,
|
|
277
|
+
subject: 'Template Email', // Subject is defined in template
|
|
278
|
+
content: [], // Required by SendGridMailData interface
|
|
279
|
+
template_id: templateId,
|
|
280
|
+
dynamic_template_data: templateData,
|
|
281
|
+
};
|
|
282
|
+
const response = await this.makeApiRequest('/mail/send', {
|
|
283
|
+
method: 'POST',
|
|
284
|
+
body: JSON.stringify(mailData),
|
|
285
|
+
});
|
|
286
|
+
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
287
|
+
const responseBody = JSON.parse(response.body);
|
|
288
|
+
return {
|
|
289
|
+
success: true,
|
|
290
|
+
messageId: responseBody.id || this.generateMessageId(),
|
|
291
|
+
providerResponse: responseBody,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
const errorBody = JSON.parse(response.body);
|
|
296
|
+
return {
|
|
297
|
+
success: false,
|
|
298
|
+
errorMessage: errorBody.errors?.[0]?.message || `HTTP ${response.statusCode}`,
|
|
299
|
+
providerResponse: errorBody,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
return {
|
|
305
|
+
success: false,
|
|
306
|
+
errorMessage: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
307
|
+
providerResponse: error,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Test the SendGrid connection
|
|
313
|
+
*/
|
|
314
|
+
async testConnection() {
|
|
315
|
+
try {
|
|
316
|
+
const response = await this.makeApiRequest('/user/profile', {
|
|
317
|
+
method: 'GET',
|
|
318
|
+
});
|
|
319
|
+
return response.statusCode === 200;
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Override configuration validation for SendGrid
|
|
327
|
+
*/
|
|
328
|
+
validateConfiguration() {
|
|
329
|
+
const errors = [];
|
|
330
|
+
const warnings = [];
|
|
331
|
+
if (!this.config.apiKey) {
|
|
332
|
+
errors.push('SendGrid API key is required');
|
|
333
|
+
}
|
|
334
|
+
if (!this.config.fromEmail) {
|
|
335
|
+
errors.push('fromEmail is required');
|
|
336
|
+
}
|
|
337
|
+
return {
|
|
338
|
+
isValid: errors.length === 0,
|
|
339
|
+
errors,
|
|
340
|
+
warnings,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Make API request to SendGrid
|
|
345
|
+
*/
|
|
346
|
+
async makeApiRequest(endpoint, options) {
|
|
347
|
+
const url = `${this.baseUrl}${endpoint}`;
|
|
348
|
+
const response = await fetch(url, {
|
|
349
|
+
method: options.method,
|
|
350
|
+
headers: {
|
|
351
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
352
|
+
'Content-Type': 'application/json',
|
|
353
|
+
},
|
|
354
|
+
body: options.body || null,
|
|
355
|
+
});
|
|
356
|
+
const body = await response.text();
|
|
357
|
+
return {
|
|
358
|
+
statusCode: response.status,
|
|
359
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
360
|
+
body,
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Verify webhook signature
|
|
365
|
+
*/
|
|
366
|
+
verifyWebhookSignature(_payload, _signature) {
|
|
367
|
+
// This is a simplified implementation
|
|
368
|
+
// In production, you should use crypto to verify the signature
|
|
369
|
+
// See: https://docs.sendgrid.com/for-developers/tracking-events/event#authentication
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Map SendGrid status to our status enum
|
|
374
|
+
*/
|
|
375
|
+
mapSendGridStatus(sendGridStatus) {
|
|
376
|
+
switch (sendGridStatus?.toLowerCase()) {
|
|
377
|
+
case 'delivered':
|
|
378
|
+
return 'delivered';
|
|
379
|
+
case 'bounce':
|
|
380
|
+
return 'bounced';
|
|
381
|
+
case 'dropped':
|
|
382
|
+
return 'failed';
|
|
383
|
+
case 'pending':
|
|
384
|
+
return 'pending';
|
|
385
|
+
case 'sent':
|
|
386
|
+
return 'sent';
|
|
387
|
+
case 'open':
|
|
388
|
+
return 'opened';
|
|
389
|
+
case 'click':
|
|
390
|
+
return 'clicked';
|
|
391
|
+
case 'spamreport':
|
|
392
|
+
return 'spam';
|
|
393
|
+
case 'unsubscribe':
|
|
394
|
+
return 'unsubscribed';
|
|
395
|
+
default:
|
|
396
|
+
return 'pending';
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Generate a message ID for tracking
|
|
401
|
+
*/
|
|
402
|
+
generateMessageId() {
|
|
403
|
+
return `sg_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
exports.SendGridProvider = SendGridProvider;
|
|
407
|
+
//# sourceMappingURL=sendgrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendgrid.js","sourceRoot":"","sources":["../../src/providers/sendgrid.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AAEF;;GAEG;AAEH,iCAAuC;AA2BvC,MAAa,gBAAiB,SAAQ,oBAAa;IAIjD,YAAY,MAA2B;QACrC,KAAK,CAAC,MAAM,CAAC,CAAC;QAHR,YAAO,GAAG,6BAA6B,CAAC;QAK9C,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,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AW;gBACd,OAAO,WAAW,CAAC;YACrB,KAAK,QAAQ;gBACX,OAAO,SAAS,CAAC;YACnB,KAAK,SAAS;gBACZ,OAAO,QAAQ,CAAC;YAClB,KAAK,SAAS;gBACZ,OAAO,SAAS,CAAC;YACnB,KAAK,MAAM;gBACT,OAAO,MAAM,CAAC;YAChB,KAAK,MAAM;gBACT,OAAO,QAAQ,CAAC;YAClB,KAAK,OAAO;gBACV,OAAO,SAAS,CAAC;YACnB,KAAK,YAAY;gBACf,OAAO,MAAM,CAAC;YAChB,KAAK,aAAa;gBAChB,OAAO,cAAc,CAAC;YACxB;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;IAED;;OAEG;IACK,iBAAiB;QACvB,OAAO,MAAM,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACvE,CAAC;CACF;AAncD,4CAmcC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS SES Email Provider
|
|
3
|
+
* Handles email sending through Amazon Simple Email Service
|
|
4
|
+
*/
|
|
5
|
+
import { EmailProvider } from './base';
|
|
6
|
+
import type { EmailMessage, SendResult, EmailProviderConfig, EmailProviderCapabilities, EmailValidationResult, EmailTemplate, DeliveryStatus, WebhookEvent } from '../types';
|
|
7
|
+
interface SesConfig extends EmailProviderConfig {
|
|
8
|
+
provider: 'ses';
|
|
9
|
+
apiKey: string;
|
|
10
|
+
secretKey: string;
|
|
11
|
+
region: string;
|
|
12
|
+
endpoint?: string;
|
|
13
|
+
sandbox?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare class SesProvider extends EmailProvider {
|
|
16
|
+
private sesClient;
|
|
17
|
+
constructor(config: SesConfig);
|
|
18
|
+
private initializeClient;
|
|
19
|
+
sendEmail(message: EmailMessage): Promise<SendResult>;
|
|
20
|
+
sendBatch(emails: EmailMessage[]): Promise<SendResult[]>;
|
|
21
|
+
private sendBatchChunk;
|
|
22
|
+
sendTemplateEmail(templateId: string, toEmail: string, variables: Record<string, any>): Promise<SendResult>;
|
|
23
|
+
createTemplate(template: Omit<EmailTemplate, 'id' | 'createdAt' | 'updatedAt'>): Promise<string>;
|
|
24
|
+
updateTemplate(template: EmailTemplate): Promise<void>;
|
|
25
|
+
deleteTemplate(templateId: string): Promise<void>;
|
|
26
|
+
getTemplate(templateId: string): Promise<EmailTemplate | null>;
|
|
27
|
+
listTemplates(): Promise<EmailTemplate[]>;
|
|
28
|
+
getDeliveryStatus(messageId: string): Promise<DeliveryStatus | null>;
|
|
29
|
+
processWebhook(_payload: any, _signature: string): Promise<WebhookEvent[]>;
|
|
30
|
+
testConnection(): Promise<boolean>;
|
|
31
|
+
validateConfiguration(): EmailValidationResult;
|
|
32
|
+
validateEmailMessage(message: EmailMessage): EmailValidationResult;
|
|
33
|
+
getCapabilities(): EmailProviderCapabilities;
|
|
34
|
+
private convertToSesMessage;
|
|
35
|
+
private formatSesError;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=ses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ses.d.ts","sourceRoot":"","sources":["../../src/providers/ses.ts"],"names":[],"mappings":"AAQA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,YAAY,EACb,MAAM,UAAU,CAAC;AAElB,UAAU,SAAU,SAAQ,mBAAmB;IAC7C,QAAQ,EAAE,KAAK,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MA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