fix: send invoice receipt addresses

This commit is contained in:
Ahmed Bouhuolia
2024-11-06 14:04:29 +02:00
parent de8a867d33
commit c32aff82ee
6 changed files with 55 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ export default class Mail {
to: string | string[];
cc: string | string[];
bcc: string | string[];
replyTo: string | string[];
from: string = `${process.env.MAIL_FROM_NAME} ${process.env.MAIL_FROM_ADDRESS}`;
data: { [key: string]: string | number };
attachments: IMailAttachment[];
@@ -27,6 +28,7 @@ export default class Mail {
subject: this.subject,
html: this.html,
attachments: this.attachments,
replyTo: this.replyTo,
};
}
@@ -74,6 +76,11 @@ export default class Mail {
return this;
}
setReplyTo(replyTo: string | string[]) {
this.replyTo = replyTo;
return this;
}
/**
* Sets from address to the mail.
* @param {string} from

View File

@@ -39,9 +39,19 @@ export class GetSaleInvoiceMailStateTransformer extends SaleInvoiceTransformer {
'companyLogoUri',
'primaryColor',
'customerName',
];
};
/**
* Retrieves the customer name of the invoice.
* @returns {string}
*/
protected customerName = (invoice) => {
return invoice.customer.displayName;
};
/**
* Retrieves the company name.
* @returns {string}