ztechno_core 0.0.125 → 0.0.126

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.
@@ -88,6 +88,7 @@ class ZMailService {
88
88
  const mailDetails = {
89
89
  from: mailOpts.from || this.opt.mailSender,
90
90
  to: mailOpts.recipient,
91
+ cc: mailOpts.cc || undefined,
91
92
  subject: mailOpts.subject,
92
93
  text: mailOpts.body || undefined,
93
94
  html: mailOpts.html || undefined,
@@ -50,6 +50,7 @@ export type MailOptionsBase = {
50
50
  recipient: string;
51
51
  subject: string;
52
52
  from?: string;
53
+ cc?: string | string[];
53
54
  priority?: 'high' | 'normal' | 'low';
54
55
  dkim?: SingleDKIMKeyOptions;
55
56
  attachments?: MailAttachment[];
@@ -96,6 +96,7 @@ export declare class InvoiceService {
96
96
  recipient?: string,
97
97
  opt?: {
98
98
  mode?: 'invoice' | 'receipt';
99
+ ccOwner?: boolean;
99
100
  },
100
101
  ): Promise<{
101
102
  invoice_number: string;
@@ -571,8 +571,8 @@ class InvoiceService {
571
571
  subscription_period_end: (0, orm_1.formatDatetime)(periodEnd),
572
572
  });
573
573
  }
574
- if (subscription && mappedStatus === 'paid' && (!hadInvoice || previousStatus !== 'paid')) {
575
- await this.sendInvoiceEmail(invoice.id, undefined, { mode: 'receipt' });
574
+ if (mappedStatus === 'paid' && (!hadInvoice || previousStatus !== 'paid')) {
575
+ await this.sendInvoiceEmail(invoice.id, undefined, { mode: 'receipt', ccOwner: true });
576
576
  }
577
577
  if (
578
578
  subscription &&
@@ -874,9 +874,11 @@ class InvoiceService {
874
874
  const content = isReceipt
875
875
  ? `<br>Beste ${customer.name},<br><br>We hebben uw betaling ontvangen. De factuur vindt u in de bijlage.<br><br>Dank u wel, ${cfg.company.companyShort}<br>`
876
876
  : `<br>Beste ${customer.name},<br><br>U vindt uw factuur in de bijlage.<br><br><a href="${pay?.payUrl}" style="display:inline-block;padding:10px 16px;background:#0d6efd;color:#fff;text-decoration:none;border-radius:6px;">Betaal nu</a><br><br>Dank u wel, ${cfg.company.companyShort}<br>`;
877
+ const cc = isReceipt ? undefined : opt?.ccOwner ? cfg.contact.contactQuote : undefined;
877
878
  await this.mailService.sendAdvanced({
878
879
  from: `${cfg.company.company} <${cfg.contact.contact}>`,
879
880
  recipient: to,
881
+ cc,
880
882
  subject,
881
883
  template: 'template.html',
882
884
  inject: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztechno_core",
3
- "version": "0.0.125",
3
+ "version": "0.0.126",
4
4
  "description": "Core files for ztechno framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",