@platform-x/hep-notification-client 1.2.9 → 1.3.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.
@@ -372,6 +372,7 @@ class EmailHandler {
372
372
  }
373
373
  if (templateData && ((_a = Object.keys(templateData)) === null || _a === void 0 ? void 0 : _a.length) !== 0) {
374
374
  const root = HTMLParser.parse(templateData === null || templateData === void 0 ? void 0 : templateData.body);
375
+ isCFF = (templateData === null || templateData === void 0 ? void 0 : templateData.email_from) && (templateData === null || templateData === void 0 ? void 0 : templateData.email_from) !== '' ? templateData === null || templateData === void 0 ? void 0 : templateData.email_from : isCFF;
375
376
  const emailConfiguration = {
376
377
  email: (_b = reqBody.replacement_variables) === null || _b === void 0 ? void 0 : _b.EMAIL,
377
378
  emailTemplate: root ? root.toString() : '',
@@ -493,7 +494,7 @@ class EmailHandler {
493
494
  }
494
495
  fetchEmailTemplateData(reqBody) {
495
496
  return __awaiter(this, void 0, void 0, function* () {
496
- var _a, _b, _c, _d;
497
+ var _a, _b, _c, _d, _e, _f;
497
498
  try {
498
499
  logger_1.Logger.info('EmailHandler: Reached fetchEmailTemplateData', 'fetchEmailTemplateData');
499
500
  let { email_type } = reqBody;
@@ -504,12 +505,14 @@ class EmailHandler {
504
505
  if ((templateSolrRes === null || templateSolrRes === void 0 ? void 0 : templateSolrRes.length) > 0) {
505
506
  templateData.body = ((_a = templateSolrRes === null || templateSolrRes === void 0 ? void 0 : templateSolrRes[0]) === null || _a === void 0 ? void 0 : _a.hclplatformx_Body) || '';
506
507
  templateData.subject = ((_b = templateSolrRes === null || templateSolrRes === void 0 ? void 0 : templateSolrRes[0]) === null || _b === void 0 ? void 0 : _b.hclplatformx_Subject) || '';
508
+ templateData.email_from = ((_c = templateSolrRes === null || templateSolrRes === void 0 ? void 0 : templateSolrRes[0]) === null || _c === void 0 ? void 0 : _c.hclplatformx_To) || '';
507
509
  }
508
510
  }
509
511
  else {
510
512
  let templateRes = yield new formBuilder_dao_1.default().fetch('email_templates', { name: email_type });
511
- templateData.body = (_c = templateRes === null || templateRes === void 0 ? void 0 : templateRes[0]) === null || _c === void 0 ? void 0 : _c.body;
512
- templateData.subject = (_d = templateRes === null || templateRes === void 0 ? void 0 : templateRes[0]) === null || _d === void 0 ? void 0 : _d.subject;
513
+ templateData.body = (_d = templateRes === null || templateRes === void 0 ? void 0 : templateRes[0]) === null || _d === void 0 ? void 0 : _d.body;
514
+ templateData.subject = (_e = templateRes === null || templateRes === void 0 ? void 0 : templateRes[0]) === null || _e === void 0 ? void 0 : _e.subject;
515
+ templateData.email_from = ((_f = templateRes === null || templateRes === void 0 ? void 0 : templateRes[0]) === null || _f === void 0 ? void 0 : _f.to) || '';
513
516
  }
514
517
  return templateData;
515
518
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-x/hep-notification-client",
3
- "version": "1.2.9",
3
+ "version": "1.3.0",
4
4
  "description": "@platform-x/hep-notification-client",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",