@etainabl/nodejs-sdk 1.3.188 → 1.3.191
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/esm/index.js +7 -51
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -51
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -6280,39 +6280,11 @@ var emailTemplate_default = (options) => {
|
|
|
6280
6280
|
|
|
6281
6281
|
// src/notificationEmailTemplate.ts
|
|
6282
6282
|
import mjml2html from "mjml";
|
|
6283
|
-
var severityConfig = {
|
|
6284
|
-
error: {
|
|
6285
|
-
color: "#FFFFFF",
|
|
6286
|
-
bgColor: "#e04f1a",
|
|
6287
|
-
label: "ERROR"
|
|
6288
|
-
},
|
|
6289
|
-
success: {
|
|
6290
|
-
color: "#FFFFFF",
|
|
6291
|
-
bgColor: "#82b54b",
|
|
6292
|
-
label: "SUCCESS"
|
|
6293
|
-
},
|
|
6294
|
-
warning: {
|
|
6295
|
-
color: "#FFFFFF",
|
|
6296
|
-
bgColor: "#ff9f43",
|
|
6297
|
-
label: "WARNING"
|
|
6298
|
-
},
|
|
6299
|
-
tip: {
|
|
6300
|
-
color: "#FFFFFF",
|
|
6301
|
-
bgColor: "#00bad1",
|
|
6302
|
-
label: "TIP"
|
|
6303
|
-
},
|
|
6304
|
-
info: {
|
|
6305
|
-
color: "#FFFFFF",
|
|
6306
|
-
bgColor: "#5ECFB1",
|
|
6307
|
-
label: "INFO"
|
|
6308
|
-
}
|
|
6309
|
-
};
|
|
6310
6283
|
function generateNotificationEmail(options) {
|
|
6311
6284
|
if (!process.env.ETAINABL_UI_URL) {
|
|
6312
6285
|
throw new Error("ETAINABL_UI_URL environment variable is not set");
|
|
6313
6286
|
}
|
|
6314
|
-
const { title, message,
|
|
6315
|
-
const config = severityConfig[severity];
|
|
6287
|
+
const { title, message, category = "Notification", actions = [], metadata = {}, items = [] } = options;
|
|
6316
6288
|
const isSingleItem = items.length === 1;
|
|
6317
6289
|
const hasMultipleItems = items.length > 1;
|
|
6318
6290
|
const mainTitle = isSingleItem && items[0]?.message ? items[0].message : message;
|
|
@@ -6330,17 +6302,6 @@ function generateNotificationEmail(options) {
|
|
|
6330
6302
|
</mj-attributes>
|
|
6331
6303
|
|
|
6332
6304
|
<mj-style inline="inline">
|
|
6333
|
-
.severity-badge {
|
|
6334
|
-
display: inline-block;
|
|
6335
|
-
padding: 2px 6px;
|
|
6336
|
-
border-radius: 6px;
|
|
6337
|
-
font-size: 9px;
|
|
6338
|
-
font-weight: 600;
|
|
6339
|
-
letter-spacing: 0.5px;
|
|
6340
|
-
background-color: ${config.bgColor};
|
|
6341
|
-
color: ${config.color};
|
|
6342
|
-
}
|
|
6343
|
-
|
|
6344
6305
|
.metadata-table {
|
|
6345
6306
|
width: 100%;
|
|
6346
6307
|
border-collapse: collapse;
|
|
@@ -6385,15 +6346,10 @@ function generateNotificationEmail(options) {
|
|
|
6385
6346
|
<!-- Main Content Card -->
|
|
6386
6347
|
<mj-wrapper background-color="#FFFFFF" border-radius="8px" padding="0">
|
|
6387
6348
|
|
|
6388
|
-
<!--
|
|
6349
|
+
<!-- Category -->
|
|
6389
6350
|
<mj-section padding="32px 32px 20px 32px">
|
|
6390
|
-
<mj-column
|
|
6391
|
-
<mj-text padding="0"
|
|
6392
|
-
<span class="severity-badge">${config.label}</span>
|
|
6393
|
-
</mj-text>
|
|
6394
|
-
</mj-column>
|
|
6395
|
-
<mj-column width="50%">
|
|
6396
|
-
<mj-text padding="0" align="right" color="#6B7280" font-size="12px">
|
|
6351
|
+
<mj-column>
|
|
6352
|
+
<mj-text padding="0" color="#6B7280" font-size="12px">
|
|
6397
6353
|
${category}
|
|
6398
6354
|
</mj-text>
|
|
6399
6355
|
</mj-column>
|
|
@@ -6484,7 +6440,7 @@ function generateNotificationEmail(options) {
|
|
|
6484
6440
|
${actions.map(
|
|
6485
6441
|
(action) => `
|
|
6486
6442
|
<mj-button
|
|
6487
|
-
background-color="
|
|
6443
|
+
background-color="#65c198"
|
|
6488
6444
|
color="#FFFFFF"
|
|
6489
6445
|
border-radius="6px"
|
|
6490
6446
|
font-weight="600"
|
|
@@ -6511,7 +6467,7 @@ function generateNotificationEmail(options) {
|
|
|
6511
6467
|
font-weight="600"
|
|
6512
6468
|
font-size="14px"
|
|
6513
6469
|
padding="12px 24px"
|
|
6514
|
-
href="${process.env.ETAINABL_UI_URL}/
|
|
6470
|
+
href="${process.env.ETAINABL_UI_URL}/notifications/inbox"
|
|
6515
6471
|
align="center"
|
|
6516
6472
|
width="100%"
|
|
6517
6473
|
>
|
|
@@ -6547,7 +6503,7 @@ function generateNotificationEmail(options) {
|
|
|
6547
6503
|
<mj-column>
|
|
6548
6504
|
<mj-text align="center" font-size="12px" color="#6B7280" line-height="1.5">
|
|
6549
6505
|
This is an automated notification from Etainabl<br/>
|
|
6550
|
-
<a href="${process.env.ETAINABL_UI_URL}/
|
|
6506
|
+
<a href="${process.env.ETAINABL_UI_URL}/notifications/inbox" style="color: #5ECFB1; text-decoration: none;">Manage notification preferences</a>
|
|
6551
6507
|
</mj-text>
|
|
6552
6508
|
<mj-text align="center" font-size="11px" color="#9CA3AF" padding-top="16px">
|
|
6553
6509
|
\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} Etainabl Ltd. All rights reserved.
|