rez_core 2.2.185 → 2.2.186

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": "rez_core",
3
- "version": "2.2.185",
3
+ "version": "2.2.186",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -62,8 +62,8 @@ export class OtpController {
62
62
  @Body()
63
63
  body: {
64
64
  to: string;
65
- cc: string;
66
- bcc: string;
65
+ cc?: string;
66
+ bcc?: string;
67
67
  subject: string;
68
68
  message: string;
69
69
  templateCode: string;
@@ -66,8 +66,8 @@ export class EmailService {
66
66
  email: string,
67
67
  subject: string,
68
68
  templateCode: string,
69
- cc: string[] = [],
70
- bcc: string[] = [],
69
+ cc?: string[],
70
+ bcc?: string[],
71
71
  message?: string,
72
72
  context?: any,
73
73
  icsPayload?: any,
@@ -104,15 +104,23 @@ export class EmailService {
104
104
  }
105
105
  }
106
106
 
107
- // Send the email
108
- await this.mailerService.sendMail({
107
+ const mailOptions: any = {
109
108
  to: email,
110
- cc: cc.length > 0 ? cc : undefined,
111
- bcc: bcc.length > 0 ? bcc : undefined,
112
109
  subject,
113
110
  html: htmlContent,
114
111
  attachments,
115
- });
112
+ };
113
+
114
+ if (cc && cc.length > 0) {
115
+ mailOptions.cc = cc;
116
+ }
117
+
118
+ if (bcc && bcc.length > 0) {
119
+ mailOptions.bcc = bcc;
120
+ }
121
+
122
+ // Send the email
123
+ await this.mailerService.sendMail(mailOptions);
116
124
 
117
125
  return { success: true, message: 'Email sent successfully' };
118
126
  }