gemcap-be-common 1.3.23 → 1.3.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.3.23",
3
+ "version": "1.3.25",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,11 @@
1
+ <html lang="en">
2
+ <body>
3
+
4
+ <p>Dear ${AUDITOR_NAME}</p>
5
+
6
+ <p>Your password is ${MONTH}.</p>
7
+
8
+ ${signature}
9
+
10
+ </body>
11
+ </html>
@@ -0,0 +1,11 @@
1
+ <html lang="en">
2
+ <body>
3
+
4
+ <p>Dear ${AUDITOR_NAME}</p>
5
+
6
+ <p>Your password is ${PASSWORD}.</p>
7
+
8
+ ${signature}
9
+
10
+ </body>
11
+ </html>
@@ -0,0 +1,11 @@
1
+ <html lang="en">
2
+ <body>
3
+
4
+ <p>Dear ${AUDITOR_NAME}</p>
5
+
6
+ <p>Your password is ${MONTH}.</p>
7
+
8
+ ${signature}
9
+
10
+ </body>
11
+ </html>
@@ -94,5 +94,11 @@ export declare class NodemailerService {
94
94
  hasEmptyFields: boolean;
95
95
  requiredGroups: string[];
96
96
  }): Promise<void>;
97
+ sendAuditorResetPasswordEmail(emailData: {
98
+ email: string;
99
+ password: string;
100
+ name: string;
101
+ subject: string;
102
+ }): Promise<void>;
97
103
  }
98
104
  export {};
@@ -695,5 +695,29 @@ class NodemailerService {
695
695
  this.sentryService.catchErrorBySentry(null, e);
696
696
  }
697
697
  }
698
+ async sendAuditorResetPasswordEmail(emailData) {
699
+ const textPath = path_1.default.resolve(__dirname, '../public/emails', 'auditor-reset.html');
700
+ const text = await fs.promises.readFile(textPath, 'utf8');
701
+ const signature = await this.getSignatureAsync(ESenderType.NEW_BUSINESS);
702
+ const replacedData = text
703
+ .replaceAll('${AUDITOR_NAME}', emailData.name)
704
+ .replaceAll('${PASSWORD}', emailData.password)
705
+ .replaceAll('${signature}', signature);
706
+ try {
707
+ this.transporter.sendMail({
708
+ from: this.getSender(ESenderType.NEW_BUSINESS),
709
+ to: [...this.config.hiddenRecipient, emailData.email],
710
+ cc: this.getSender(ESenderType.NEW_BUSINESS),
711
+ subject: emailData.subject,
712
+ text: replacedData,
713
+ html: replacedData,
714
+ }, async (err, info) => {
715
+ await this.senderHandler(err, info);
716
+ });
717
+ }
718
+ catch (e) {
719
+ this.sentryService.catchErrorBySentry(null, e);
720
+ }
721
+ }
698
722
  }
699
723
  exports.NodemailerService = NodemailerService;
@@ -782,4 +782,28 @@ export class NodemailerService {
782
782
  this.sentryService.catchErrorBySentry(null, e);
783
783
  }
784
784
  }
785
+
786
+ async sendAuditorResetPasswordEmail(emailData: { email: string; password: string; name: string; subject: string }) {
787
+ const textPath = path.resolve(__dirname, '../public/emails', 'auditor-reset.html');
788
+ const text = await fs.promises.readFile(textPath, 'utf8');
789
+ const signature = await this.getSignatureAsync(ESenderType.NEW_BUSINESS);
790
+ const replacedData = text
791
+ .replaceAll('${AUDITOR_NAME}', emailData.name)
792
+ .replaceAll('${PASSWORD}', emailData.password)
793
+ .replaceAll('${signature}', signature);
794
+ try {
795
+ this.transporter.sendMail({
796
+ from: this.getSender(ESenderType.NEW_BUSINESS),
797
+ to: [...this.config.hiddenRecipient, emailData.email],
798
+ cc: this.getSender(ESenderType.NEW_BUSINESS),
799
+ subject: emailData.subject,
800
+ text: replacedData,
801
+ html: replacedData,
802
+ }, async (err, info) => {
803
+ await this.senderHandler(err, info);
804
+ });
805
+ } catch (e) {
806
+ this.sentryService.catchErrorBySentry(null, e);
807
+ }
808
+ }
785
809
  }