@shogo-ai/email 2.4.5 → 2.4.7
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/dist/{chunk-NKFT5JLE.js → chunk-QOA2QDKJ.js} +49 -1
- package/dist/index.cjs +48 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/server.cjs +52 -1
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +5 -2
- package/dist/{types-CCHryvHe.d.cts → types-szNtZ5IF.d.cts} +12 -0
- package/dist/{types-CCHryvHe.d.ts → types-szNtZ5IF.d.ts} +12 -0
- package/package.json +1 -1
|
@@ -1211,6 +1211,51 @@ var dripHeartbeatTemplate = {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
};
|
|
1213
1213
|
|
|
1214
|
+
// src/templates/lifecycle/build-ready.ts
|
|
1215
|
+
var buildReadyTemplate = {
|
|
1216
|
+
name: "build-ready",
|
|
1217
|
+
subject: "{{projectName}} is ready",
|
|
1218
|
+
html: wrapInLayout(`
|
|
1219
|
+
<h1 class="email-h1">{{projectName}} is ready</h1>
|
|
1220
|
+
<p class="email-text">
|
|
1221
|
+
Your agent finished a turn in <strong>{{projectName}}</strong> and there
|
|
1222
|
+
is something to look at.
|
|
1223
|
+
</p>
|
|
1224
|
+
<p class="email-text">{{summary}}</p>
|
|
1225
|
+
<a href="{{projectUrl}}" class="email-btn">Open the project</a>
|
|
1226
|
+
<hr class="email-divider">
|
|
1227
|
+
<p class="email-muted">
|
|
1228
|
+
You're getting this because you started a build and stepped away.
|
|
1229
|
+
<a href="{{preferencesUrl}}">Turn these emails off</a>.
|
|
1230
|
+
</p>
|
|
1231
|
+
`),
|
|
1232
|
+
defaults: {
|
|
1233
|
+
appName: EMAIL_CONSTANTS.APP_NAME
|
|
1234
|
+
}
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
// src/templates/lifecycle/credits-reset.ts
|
|
1238
|
+
var creditsResetTemplate = {
|
|
1239
|
+
name: "credits-reset",
|
|
1240
|
+
subject: "Your agent is back \u2014 pick up {{projectName}}",
|
|
1241
|
+
html: wrapInLayout(`
|
|
1242
|
+
<h1 class="email-h1">Your agent is back</h1>
|
|
1243
|
+
<p class="email-text">
|
|
1244
|
+
Your usage limit reset at <strong>{{resetAt}}</strong>, so
|
|
1245
|
+
<strong>{{projectName}}</strong> can keep going.
|
|
1246
|
+
</p>
|
|
1247
|
+
<a href="{{continueUrl}}" class="email-btn">Continue where you left off</a>
|
|
1248
|
+
<hr class="email-divider">
|
|
1249
|
+
<p class="email-muted">
|
|
1250
|
+
You're getting this once because you hit a limit and left.
|
|
1251
|
+
<a href="{{preferencesUrl}}">Turn these emails off</a>.
|
|
1252
|
+
</p>
|
|
1253
|
+
`),
|
|
1254
|
+
defaults: {
|
|
1255
|
+
appName: EMAIL_CONSTANTS.APP_NAME
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1214
1259
|
// src/templates/lifecycle/conversion.ts
|
|
1215
1260
|
var conversionUsageLimitTemplate = {
|
|
1216
1261
|
name: "conversion-usage-limit",
|
|
@@ -1382,6 +1427,9 @@ var allTemplates = [
|
|
|
1382
1427
|
dripReEngagementTemplate,
|
|
1383
1428
|
dripPowerUpTemplate,
|
|
1384
1429
|
dripHeartbeatTemplate,
|
|
1430
|
+
// Lifecycle — Activation
|
|
1431
|
+
buildReadyTemplate,
|
|
1432
|
+
creditsResetTemplate,
|
|
1385
1433
|
// Lifecycle — Conversion
|
|
1386
1434
|
conversionUsageLimitTemplate,
|
|
1387
1435
|
conversionPowerUserTemplate,
|
|
@@ -1413,4 +1461,4 @@ export {
|
|
|
1413
1461
|
allTemplates,
|
|
1414
1462
|
createShogoTemplateRegistry
|
|
1415
1463
|
};
|
|
1416
|
-
//# sourceMappingURL=chunk-
|
|
1464
|
+
//# sourceMappingURL=chunk-QOA2QDKJ.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1252,6 +1252,51 @@ var dripHeartbeatTemplate = {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
};
|
|
1254
1254
|
|
|
1255
|
+
// src/templates/lifecycle/build-ready.ts
|
|
1256
|
+
var buildReadyTemplate = {
|
|
1257
|
+
name: "build-ready",
|
|
1258
|
+
subject: "{{projectName}} is ready",
|
|
1259
|
+
html: wrapInLayout(`
|
|
1260
|
+
<h1 class="email-h1">{{projectName}} is ready</h1>
|
|
1261
|
+
<p class="email-text">
|
|
1262
|
+
Your agent finished a turn in <strong>{{projectName}}</strong> and there
|
|
1263
|
+
is something to look at.
|
|
1264
|
+
</p>
|
|
1265
|
+
<p class="email-text">{{summary}}</p>
|
|
1266
|
+
<a href="{{projectUrl}}" class="email-btn">Open the project</a>
|
|
1267
|
+
<hr class="email-divider">
|
|
1268
|
+
<p class="email-muted">
|
|
1269
|
+
You're getting this because you started a build and stepped away.
|
|
1270
|
+
<a href="{{preferencesUrl}}">Turn these emails off</a>.
|
|
1271
|
+
</p>
|
|
1272
|
+
`),
|
|
1273
|
+
defaults: {
|
|
1274
|
+
appName: EMAIL_CONSTANTS.APP_NAME
|
|
1275
|
+
}
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
// src/templates/lifecycle/credits-reset.ts
|
|
1279
|
+
var creditsResetTemplate = {
|
|
1280
|
+
name: "credits-reset",
|
|
1281
|
+
subject: "Your agent is back \u2014 pick up {{projectName}}",
|
|
1282
|
+
html: wrapInLayout(`
|
|
1283
|
+
<h1 class="email-h1">Your agent is back</h1>
|
|
1284
|
+
<p class="email-text">
|
|
1285
|
+
Your usage limit reset at <strong>{{resetAt}}</strong>, so
|
|
1286
|
+
<strong>{{projectName}}</strong> can keep going.
|
|
1287
|
+
</p>
|
|
1288
|
+
<a href="{{continueUrl}}" class="email-btn">Continue where you left off</a>
|
|
1289
|
+
<hr class="email-divider">
|
|
1290
|
+
<p class="email-muted">
|
|
1291
|
+
You're getting this once because you hit a limit and left.
|
|
1292
|
+
<a href="{{preferencesUrl}}">Turn these emails off</a>.
|
|
1293
|
+
</p>
|
|
1294
|
+
`),
|
|
1295
|
+
defaults: {
|
|
1296
|
+
appName: EMAIL_CONSTANTS.APP_NAME
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1255
1300
|
// src/templates/lifecycle/conversion.ts
|
|
1256
1301
|
var conversionUsageLimitTemplate = {
|
|
1257
1302
|
name: "conversion-usage-limit",
|
|
@@ -1423,6 +1468,9 @@ var allTemplates = [
|
|
|
1423
1468
|
dripReEngagementTemplate,
|
|
1424
1469
|
dripPowerUpTemplate,
|
|
1425
1470
|
dripHeartbeatTemplate,
|
|
1471
|
+
// Lifecycle — Activation
|
|
1472
|
+
buildReadyTemplate,
|
|
1473
|
+
creditsResetTemplate,
|
|
1426
1474
|
// Lifecycle — Conversion
|
|
1427
1475
|
conversionUsageLimitTemplate,
|
|
1428
1476
|
conversionPowerUserTemplate,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EmailTemplate } from './types-
|
|
2
|
-
export { a as EmailAddress, b as EmailConfig, c as EmailError, d as EmailErrorCode, e as EmailProviderType, f as EmailResult, I as IEmailProvider, g as IEmailService, O as OciEmailConfig, S as SendEmailParams, h as SendTemplateParams, i as SesConfig, j as SmtpConfig, T as TemplateRegistry, k as formatEmailAddress } from './types-
|
|
1
|
+
import { E as EmailTemplate } from './types-szNtZ5IF.cjs';
|
|
2
|
+
export { a as EmailAddress, b as EmailConfig, c as EmailError, d as EmailErrorCode, e as EmailProviderType, f as EmailResult, I as IEmailProvider, g as IEmailService, O as OciEmailConfig, S as SendEmailParams, h as SendTemplateParams, i as SesConfig, j as SmtpConfig, T as TemplateRegistry, k as formatEmailAddress } from './types-szNtZ5IF.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Email Template System
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EmailTemplate } from './types-
|
|
2
|
-
export { a as EmailAddress, b as EmailConfig, c as EmailError, d as EmailErrorCode, e as EmailProviderType, f as EmailResult, I as IEmailProvider, g as IEmailService, O as OciEmailConfig, S as SendEmailParams, h as SendTemplateParams, i as SesConfig, j as SmtpConfig, T as TemplateRegistry, k as formatEmailAddress } from './types-
|
|
1
|
+
import { E as EmailTemplate } from './types-szNtZ5IF.js';
|
|
2
|
+
export { a as EmailAddress, b as EmailConfig, c as EmailError, d as EmailErrorCode, e as EmailProviderType, f as EmailResult, I as IEmailProvider, g as IEmailService, O as OciEmailConfig, S as SendEmailParams, h as SendTemplateParams, i as SesConfig, j as SmtpConfig, T as TemplateRegistry, k as formatEmailAddress } from './types-szNtZ5IF.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Email Template System
|
package/dist/index.js
CHANGED
package/dist/server.cjs
CHANGED
|
@@ -120,7 +120,7 @@ var SmtpProvider = class {
|
|
|
120
120
|
* Send an email via SMTP
|
|
121
121
|
*/
|
|
122
122
|
async send(params) {
|
|
123
|
-
const { to, subject, html, text, from, replyTo, cc, bcc } = params;
|
|
123
|
+
const { to, subject, html, text, from, replyTo, cc, bcc, headers } = params;
|
|
124
124
|
if (!from) {
|
|
125
125
|
throw EmailError.configMissing("from address");
|
|
126
126
|
}
|
|
@@ -142,6 +142,9 @@ var SmtpProvider = class {
|
|
|
142
142
|
if (bcc) {
|
|
143
143
|
mailOptions.bcc = this.formatRecipients(bcc);
|
|
144
144
|
}
|
|
145
|
+
if (headers && Object.keys(headers).length > 0) {
|
|
146
|
+
mailOptions.headers = headers;
|
|
147
|
+
}
|
|
145
148
|
const info = await transporter.sendMail(mailOptions);
|
|
146
149
|
return {
|
|
147
150
|
success: true,
|
|
@@ -1327,6 +1330,51 @@ var dripHeartbeatTemplate = {
|
|
|
1327
1330
|
}
|
|
1328
1331
|
};
|
|
1329
1332
|
|
|
1333
|
+
// src/templates/lifecycle/build-ready.ts
|
|
1334
|
+
var buildReadyTemplate = {
|
|
1335
|
+
name: "build-ready",
|
|
1336
|
+
subject: "{{projectName}} is ready",
|
|
1337
|
+
html: wrapInLayout(`
|
|
1338
|
+
<h1 class="email-h1">{{projectName}} is ready</h1>
|
|
1339
|
+
<p class="email-text">
|
|
1340
|
+
Your agent finished a turn in <strong>{{projectName}}</strong> and there
|
|
1341
|
+
is something to look at.
|
|
1342
|
+
</p>
|
|
1343
|
+
<p class="email-text">{{summary}}</p>
|
|
1344
|
+
<a href="{{projectUrl}}" class="email-btn">Open the project</a>
|
|
1345
|
+
<hr class="email-divider">
|
|
1346
|
+
<p class="email-muted">
|
|
1347
|
+
You're getting this because you started a build and stepped away.
|
|
1348
|
+
<a href="{{preferencesUrl}}">Turn these emails off</a>.
|
|
1349
|
+
</p>
|
|
1350
|
+
`),
|
|
1351
|
+
defaults: {
|
|
1352
|
+
appName: EMAIL_CONSTANTS.APP_NAME
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1356
|
+
// src/templates/lifecycle/credits-reset.ts
|
|
1357
|
+
var creditsResetTemplate = {
|
|
1358
|
+
name: "credits-reset",
|
|
1359
|
+
subject: "Your agent is back \u2014 pick up {{projectName}}",
|
|
1360
|
+
html: wrapInLayout(`
|
|
1361
|
+
<h1 class="email-h1">Your agent is back</h1>
|
|
1362
|
+
<p class="email-text">
|
|
1363
|
+
Your usage limit reset at <strong>{{resetAt}}</strong>, so
|
|
1364
|
+
<strong>{{projectName}}</strong> can keep going.
|
|
1365
|
+
</p>
|
|
1366
|
+
<a href="{{continueUrl}}" class="email-btn">Continue where you left off</a>
|
|
1367
|
+
<hr class="email-divider">
|
|
1368
|
+
<p class="email-muted">
|
|
1369
|
+
You're getting this once because you hit a limit and left.
|
|
1370
|
+
<a href="{{preferencesUrl}}">Turn these emails off</a>.
|
|
1371
|
+
</p>
|
|
1372
|
+
`),
|
|
1373
|
+
defaults: {
|
|
1374
|
+
appName: EMAIL_CONSTANTS.APP_NAME
|
|
1375
|
+
}
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1330
1378
|
// src/templates/lifecycle/conversion.ts
|
|
1331
1379
|
var conversionUsageLimitTemplate = {
|
|
1332
1380
|
name: "conversion-usage-limit",
|
|
@@ -1498,6 +1546,9 @@ var allTemplates = [
|
|
|
1498
1546
|
dripReEngagementTemplate,
|
|
1499
1547
|
dripPowerUpTemplate,
|
|
1500
1548
|
dripHeartbeatTemplate,
|
|
1549
|
+
// Lifecycle — Activation
|
|
1550
|
+
buildReadyTemplate,
|
|
1551
|
+
creditsResetTemplate,
|
|
1501
1552
|
// Lifecycle — Conversion
|
|
1502
1553
|
conversionUsageLimitTemplate,
|
|
1503
1554
|
conversionPowerUserTemplate,
|
package/dist/server.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as EmailConfig, a as EmailAddress, g as IEmailService } from './types-
|
|
2
|
-
export { f as EmailResult, E as EmailTemplate, S as SendEmailParams, h as SendTemplateParams } from './types-
|
|
1
|
+
import { b as EmailConfig, a as EmailAddress, g as IEmailService } from './types-szNtZ5IF.cjs';
|
|
2
|
+
export { f as EmailResult, E as EmailTemplate, S as SendEmailParams, h as SendTemplateParams } from './types-szNtZ5IF.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Email Service - Server Side
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as EmailConfig, a as EmailAddress, g as IEmailService } from './types-
|
|
2
|
-
export { f as EmailResult, E as EmailTemplate, S as SendEmailParams, h as SendTemplateParams } from './types-
|
|
1
|
+
import { b as EmailConfig, a as EmailAddress, g as IEmailService } from './types-szNtZ5IF.js';
|
|
2
|
+
export { f as EmailResult, E as EmailTemplate, S as SendEmailParams, h as SendTemplateParams } from './types-szNtZ5IF.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Email Service - Server Side
|
package/dist/server.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
EmailTemplateRegistry,
|
|
4
4
|
createShogoTemplateRegistry,
|
|
5
5
|
formatEmailAddress
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QOA2QDKJ.js";
|
|
7
7
|
|
|
8
8
|
// src/providers/smtp.ts
|
|
9
9
|
var SmtpProvider = class {
|
|
@@ -65,7 +65,7 @@ var SmtpProvider = class {
|
|
|
65
65
|
* Send an email via SMTP
|
|
66
66
|
*/
|
|
67
67
|
async send(params) {
|
|
68
|
-
const { to, subject, html, text, from, replyTo, cc, bcc } = params;
|
|
68
|
+
const { to, subject, html, text, from, replyTo, cc, bcc, headers } = params;
|
|
69
69
|
if (!from) {
|
|
70
70
|
throw EmailError.configMissing("from address");
|
|
71
71
|
}
|
|
@@ -87,6 +87,9 @@ var SmtpProvider = class {
|
|
|
87
87
|
if (bcc) {
|
|
88
88
|
mailOptions.bcc = this.formatRecipients(bcc);
|
|
89
89
|
}
|
|
90
|
+
if (headers && Object.keys(headers).length > 0) {
|
|
91
|
+
mailOptions.headers = headers;
|
|
92
|
+
}
|
|
90
93
|
const info = await transporter.sendMail(mailOptions);
|
|
91
94
|
return {
|
|
92
95
|
success: true,
|
|
@@ -35,6 +35,12 @@ interface SendEmailParams {
|
|
|
35
35
|
cc?: EmailAddress | EmailAddress[];
|
|
36
36
|
/** BCC recipients */
|
|
37
37
|
bcc?: EmailAddress | EmailAddress[];
|
|
38
|
+
/**
|
|
39
|
+
* Extra raw headers, e.g. `List-Unsubscribe` on lifecycle mail. Providers
|
|
40
|
+
* that speak raw MIME (SMTP) send them; the JSON-based providers ignore the
|
|
41
|
+
* field rather than failing the send.
|
|
42
|
+
*/
|
|
43
|
+
headers?: Record<string, string>;
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
46
|
* Parameters for sending a templated email
|
|
@@ -54,6 +60,12 @@ interface SendTemplateParams<TData extends Record<string, unknown> = Record<stri
|
|
|
54
60
|
cc?: EmailAddress | EmailAddress[];
|
|
55
61
|
/** BCC recipients */
|
|
56
62
|
bcc?: EmailAddress | EmailAddress[];
|
|
63
|
+
/**
|
|
64
|
+
* Extra raw headers, e.g. `List-Unsubscribe` on lifecycle mail. Providers
|
|
65
|
+
* that speak raw MIME (SMTP) send them; the JSON-based providers ignore the
|
|
66
|
+
* field rather than failing the send.
|
|
67
|
+
*/
|
|
68
|
+
headers?: Record<string, string>;
|
|
57
69
|
}
|
|
58
70
|
/**
|
|
59
71
|
* Result from sending an email
|
|
@@ -35,6 +35,12 @@ interface SendEmailParams {
|
|
|
35
35
|
cc?: EmailAddress | EmailAddress[];
|
|
36
36
|
/** BCC recipients */
|
|
37
37
|
bcc?: EmailAddress | EmailAddress[];
|
|
38
|
+
/**
|
|
39
|
+
* Extra raw headers, e.g. `List-Unsubscribe` on lifecycle mail. Providers
|
|
40
|
+
* that speak raw MIME (SMTP) send them; the JSON-based providers ignore the
|
|
41
|
+
* field rather than failing the send.
|
|
42
|
+
*/
|
|
43
|
+
headers?: Record<string, string>;
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
46
|
* Parameters for sending a templated email
|
|
@@ -54,6 +60,12 @@ interface SendTemplateParams<TData extends Record<string, unknown> = Record<stri
|
|
|
54
60
|
cc?: EmailAddress | EmailAddress[];
|
|
55
61
|
/** BCC recipients */
|
|
56
62
|
bcc?: EmailAddress | EmailAddress[];
|
|
63
|
+
/**
|
|
64
|
+
* Extra raw headers, e.g. `List-Unsubscribe` on lifecycle mail. Providers
|
|
65
|
+
* that speak raw MIME (SMTP) send them; the JSON-based providers ignore the
|
|
66
|
+
* field rather than failing the send.
|
|
67
|
+
*/
|
|
68
|
+
headers?: Record<string, string>;
|
|
57
69
|
}
|
|
58
70
|
/**
|
|
59
71
|
* Result from sending an email
|
package/package.json
CHANGED