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.
package/lib/core/mail_service.js
CHANGED
|
@@ -571,8 +571,8 @@ class InvoiceService {
|
|
|
571
571
|
subscription_period_end: (0, orm_1.formatDatetime)(periodEnd),
|
|
572
572
|
});
|
|
573
573
|
}
|
|
574
|
-
if (
|
|
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: {
|