@platform-x/hep-notification-client 1.2.2 → 1.2.3

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.
File without changes
File without changes
@@ -42,7 +42,7 @@ export declare class EmailHandler {
42
42
  * @param emailConfig
43
43
  * @returns
44
44
  */
45
- sendEmailWithPersonalizations(emailConfig: any, isCFF?: any): Promise<unknown>;
45
+ sendEmailWithPersonalizations(emailConfig: any, email_from?: any): Promise<unknown>;
46
46
  /**
47
47
  * Utility method to prepare CC emails in standardized format
48
48
  * @param ccEmails - Can be string, array of strings, or Recipients array
@@ -226,12 +226,12 @@ class EmailHandler {
226
226
  * @param emailConfig
227
227
  * @returns
228
228
  */
229
- sendEmailWithPersonalizations(emailConfig, isCFF) {
229
+ sendEmailWithPersonalizations(emailConfig, email_from) {
230
230
  return __awaiter(this, void 0, void 0, function* () {
231
231
  logger_1.Logger.info(`EmailHandler: Reached sendEmailWithPersonalizations method with emailConfig: ${JSON.stringify(emailConfig)}`, 'sendEmailWithPersonalizations');
232
232
  logger_1.Logger.info(`EMAIL_FROM-------> ${config_1.default === null || config_1.default === void 0 ? void 0 : config_1.default.EMAIL_FROM}`, 'triggerEmails');
233
233
  const Mail = sgHelpers.classes.Mail;
234
- let email_from = isCFF ? config_1.default === null || config_1.default === void 0 ? void 0 : config_1.default.CFF_MAIL_FROM : config_1.default === null || config_1.default === void 0 ? void 0 : config_1.default.EMAIL_FROM;
234
+ // let email_from = isCFF ? config?.CFF_MAIL_FROM : config?.EMAIL_FROM;
235
235
  logger_1.Logger.info('sendEmailWithPersonalizations : Email From:', JSON.stringify(email_from));
236
236
  const Personalization = sgHelpers.classes.Personalization;
237
237
  const secrets = yield (0, __1.getIAMSecrets)();
@@ -340,7 +340,7 @@ class EmailHandler {
340
340
  return __awaiter(this, void 0, void 0, function* () {
341
341
  var _a, _b;
342
342
  try {
343
- let { email_type, replacement_variables, recipients, cc_recipients, isCFF = false } = reqBody;
343
+ let { email_type, replacement_variables, recipients, cc_recipients, isCFF = config_1.default === null || config_1.default === void 0 ? void 0 : config_1.default.EMAIL_FROM } = reqBody;
344
344
  logger_1.Logger.info(`EmailHandler: reached in sendPersonalizeEmailRequest with emailType: ${email_type}`, 'sendPersonalizeEmailRequest');
345
345
  // disable SOLR because of connectivity issue
346
346
  logger_1.Logger.debug('Reached sendPersonalizeEmailRequest in emailHandler', 'sendPersonalizeEmailRequest');
@@ -379,9 +379,9 @@ class EmailHandler {
379
379
  personalizations: recipientsData,
380
380
  attachments: reqBody === null || reqBody === void 0 ? void 0 : reqBody.attachments,
381
381
  };
382
- let is_cff = (isCFF && isCFF === true) ? true : false;
382
+ // let is_cff: boolean = (isCFF && isCFF === true) ? true : false;
383
383
  logger_1.Logger.info(`sendPersonalizeEmailRequest -${JSON.stringify(emailConfiguration)}`, 'sendPersonalizeEmailRequest');
384
- return yield this.sendEmailWithPersonalizations(emailConfiguration, is_cff).then((response) => __awaiter(this, void 0, void 0, function* () {
384
+ return yield this.sendEmailWithPersonalizations(emailConfiguration, isCFF).then((response) => __awaiter(this, void 0, void 0, function* () {
385
385
  if (response.statusCode === 202) {
386
386
  response.msg =
387
387
  'Thanks for getting in touch with us. We shall contact you soon.';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-x/hep-notification-client",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "@platform-x/hep-notification-client",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",