mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat: change default mail template messages
This commit is contained in:
@@ -80,7 +80,13 @@ export class SendSaleEstimateMail {
|
|||||||
tenantId,
|
tenantId,
|
||||||
estimateId
|
estimateId
|
||||||
);
|
);
|
||||||
return transformEstimateToMailDataArgs(estimate);
|
const commonArgs = await this.contactMailNotification.getCommonFormatArgs(
|
||||||
|
tenantId
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
...commonArgs,
|
||||||
|
...transformEstimateToMailDataArgs(estimate),
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
export const DEFAULT_ESTIMATE_REMINDER_MAIL_SUBJECT =
|
export const DEFAULT_ESTIMATE_REMINDER_MAIL_SUBJECT =
|
||||||
'Estimate {Estimate Number} is awaiting your approval';
|
'Estimate {Estimate Number} is awaiting your approval';
|
||||||
export const DEFAULT_ESTIMATE_REMINDER_MAIL_CONTENT = `<p>Dear {Customer Name}</p>
|
export const DEFAULT_ESTIMATE_REMINDER_MAIL_CONTENT = `Hi {Customer Name},
|
||||||
<p>Thank you for your business, You can view or print your estimate from attachements.</p>
|
|
||||||
<p>
|
|
||||||
Estimate <strong>#{Estimate Number}</strong><br />
|
|
||||||
Expiration Date : <strong>{Estimate Expiration Date}</strong><br />
|
|
||||||
Amount : <strong>{Estimate Amount}</strong></br />
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
Here's estimate # {Estimate Number} for {Estimate Amount}
|
||||||
<i>Regards</i><br />
|
|
||||||
<i>{Company Name}</i>
|
This estimate is valid until {Estimate Expiration Date}, and we’re happy to discuss any adjustments you or questions may have.
|
||||||
</p>
|
|
||||||
`;
|
Please find your estimate attached to this email for your reference.
|
||||||
|
|
||||||
|
If you have any questions, please let us know.
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
{Company Name}`;
|
||||||
|
|
||||||
export const ERRORS = {
|
export const ERRORS = {
|
||||||
SALE_ESTIMATE_NOT_FOUND: 'SALE_ESTIMATE_NOT_FOUND',
|
SALE_ESTIMATE_NOT_FOUND: 'SALE_ESTIMATE_NOT_FOUND',
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Transformer } from '@/lib/Transformer/Transformer';
|
import { Transformer } from '@/lib/Transformer/Transformer';
|
||||||
import { PaymentReceivedEntryTransfromer } from './PaymentReceivedEntryTransformer';
|
|
||||||
|
|
||||||
export class GetPaymentReceivedMailTemplateAttrsTransformer extends Transformer {
|
export class GetPaymentReceivedMailTemplateAttrsTransformer extends Transformer {
|
||||||
/**
|
/**
|
||||||
@@ -13,6 +12,8 @@ export class GetPaymentReceivedMailTemplateAttrsTransformer extends Transformer
|
|||||||
'primaryColor',
|
'primaryColor',
|
||||||
'total',
|
'total',
|
||||||
'totalLabel',
|
'totalLabel',
|
||||||
|
'subtotal',
|
||||||
|
'subtotalLabel',
|
||||||
'paymentNumberLabel',
|
'paymentNumberLabel',
|
||||||
'paymentNumber',
|
'paymentNumber',
|
||||||
'items',
|
'items',
|
||||||
@@ -75,6 +76,14 @@ export class GetPaymentReceivedMailTemplateAttrsTransformer extends Transformer
|
|||||||
return this.options.paymentReceived.formattedAmount;
|
return this.options.paymentReceived.formattedAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Subtotal label.
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
public subtotalLabel(): string {
|
||||||
|
return 'Subtotal';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment number label.
|
* Payment number label.
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
export const DEFAULT_PAYMENT_MAIL_SUBJECT =
|
export const DEFAULT_PAYMENT_MAIL_SUBJECT =
|
||||||
'Payment Received for {Customer Name} from {Company Name}';
|
' Payment Confirmation from {Company Name} – Thank You!';
|
||||||
export const DEFAULT_PAYMENT_MAIL_CONTENT = `
|
export const DEFAULT_PAYMENT_MAIL_CONTENT = `Dear {Customer Name}
|
||||||
<p>Dear {Customer Name}</p>
|
|
||||||
<p>Thank you for your payment. It was a pleasure doing business with you. We look forward to work together again!</p>
|
|
||||||
<p>
|
|
||||||
Payment Date : <strong>{Payment Date}</strong><br />
|
|
||||||
Amount : <strong>{Payment Amount}</strong></br />
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
Thank you for your payment. It was a pleasure doing business with you. We look forward to work together again!
|
||||||
<i>Regards</i><br />
|
|
||||||
<i>{Company Name}</i>
|
Payment Transaction: {Payment Number}
|
||||||
</p>
|
Payment Date : {Payment Date}
|
||||||
`;
|
Amount : {Payment Amount}
|
||||||
|
|
||||||
|
Regards,
|
||||||
|
{Company Name}`;
|
||||||
|
|
||||||
export const ERRORS = {
|
export const ERRORS = {
|
||||||
PAYMENT_RECEIVE_NO_EXISTS: 'PAYMENT_RECEIVE_NO_EXISTS',
|
PAYMENT_RECEIVE_NO_EXISTS: 'PAYMENT_RECEIVE_NO_EXISTS',
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ export class GetSaleReceiptMailTemplateAttributesTransformer extends Transformer
|
|||||||
'total',
|
'total',
|
||||||
'totalLabel',
|
'totalLabel',
|
||||||
|
|
||||||
|
'subtotal',
|
||||||
|
'subtotalLabel',
|
||||||
|
|
||||||
'paidAmount',
|
'paidAmount',
|
||||||
'paidAmountLabel',
|
'paidAmountLabel',
|
||||||
|
|
||||||
@@ -64,7 +67,7 @@ export class GetSaleReceiptMailTemplateAttributesTransformer extends Transformer
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
public receiptNumber(): string {
|
public receiptNumber(): string {
|
||||||
return this.options.receipt.number;
|
return this.options.receipt.receiptNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,7 +75,7 @@ export class GetSaleReceiptMailTemplateAttributesTransformer extends Transformer
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
public receiptNumberLabel(): string {
|
public receiptNumberLabel(): string {
|
||||||
return 'Receipt Number';
|
return 'Receipt # {receiptNumber}';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -95,7 +98,7 @@ export class GetSaleReceiptMailTemplateAttributesTransformer extends Transformer
|
|||||||
* Receipt total.
|
* Receipt total.
|
||||||
*/
|
*/
|
||||||
public total(): string {
|
public total(): string {
|
||||||
return this.options.receipt.totalFormatted;
|
return this.options.receipt.formattedAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,6 +109,22 @@ export class GetSaleReceiptMailTemplateAttributesTransformer extends Transformer
|
|||||||
return 'Total';
|
return 'Total';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Receipt subtotal.
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
public subtotal(): string {
|
||||||
|
return this.options.receipt.formattedSubtotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Receipt subtotal label.
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
public subtotalLabel(): string {
|
||||||
|
return 'Subtotal';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receipt mail items attributes.
|
* Receipt mail items attributes.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -115,7 +115,13 @@ export class SaleReceiptMailNotification {
|
|||||||
tenantId,
|
tenantId,
|
||||||
receiptId
|
receiptId
|
||||||
);
|
);
|
||||||
return transformReceiptToMailDataArgs(receipt);
|
const commonArgs = await this.contactMailNotification.getCommonFormatArgs(
|
||||||
|
tenantId
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
...commonArgs,
|
||||||
|
...transformReceiptToMailDataArgs(receipt),
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
export const DEFAULT_RECEIPT_MAIL_SUBJECT =
|
export const DEFAULT_RECEIPT_MAIL_SUBJECT =
|
||||||
'Receipt {Receipt Number} from {Company Name}';
|
'Receipt {Receipt Number} from {Company Name}';
|
||||||
export const DEFAULT_RECEIPT_MAIL_CONTENT = `
|
export const DEFAULT_RECEIPT_MAIL_CONTENT = `Hi {Customer Name},
|
||||||
<p>Dear {Customer Name}</p>
|
|
||||||
<p>Thank you for your business, You can view or print your receipt from attachements.</p>
|
|
||||||
<p>
|
|
||||||
Receipt <strong>#{Receipt Number}</strong><br />
|
|
||||||
Amount : <strong>{Receipt Amount}</strong></br />
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
Here's receipt # {Receipt Number} for Receipt {Receipt Amount}
|
||||||
<i>Regards</i><br />
|
|
||||||
<i>{Company Name}</i>
|
The receipt paid on {Receipt Date}, and the total amount paid is {Receipt Amount}.
|
||||||
</p>
|
|
||||||
`;
|
Please find your sale receipt attached to this email for your reference
|
||||||
|
|
||||||
|
If you have any questions, please let us know.
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
{Company Name}`;
|
||||||
|
|
||||||
export const ERRORS = {
|
export const ERRORS = {
|
||||||
SALE_RECEIPT_NOT_FOUND: 'SALE_RECEIPT_NOT_FOUND',
|
SALE_RECEIPT_NOT_FOUND: 'SALE_RECEIPT_NOT_FOUND',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { EmailTemplate } from './EmailTemplate';
|
|||||||
export interface ReceiptEmailTemplateProps {
|
export interface ReceiptEmailTemplateProps {
|
||||||
preview: string;
|
preview: string;
|
||||||
|
|
||||||
// # Company
|
|
||||||
companyName?: string;
|
companyName?: string;
|
||||||
companyLogoUri: string;
|
companyLogoUri: string;
|
||||||
|
|
||||||
@@ -36,10 +36,6 @@ export interface ReceiptEmailTemplateProps {
|
|||||||
subtotal?: string;
|
subtotal?: string;
|
||||||
subtotalLabel?: string;
|
subtotalLabel?: string;
|
||||||
|
|
||||||
// # View receipt button.
|
|
||||||
viewReceiptButtonLabel?: string;
|
|
||||||
viewReceiptButtonUrl?: string;
|
|
||||||
|
|
||||||
// # Message
|
// # Message
|
||||||
message?: string;
|
message?: string;
|
||||||
}
|
}
|
||||||
@@ -68,10 +64,6 @@ export const ReceiptEmailTemplate: React.FC<
|
|||||||
receiptNumberLabel = 'Receipt # {receiptNumber}',
|
receiptNumberLabel = 'Receipt # {receiptNumber}',
|
||||||
receiptNumber = 'REC-00001',
|
receiptNumber = 'REC-00001',
|
||||||
|
|
||||||
// # View invoice button
|
|
||||||
viewReceiptButtonLabel = 'View Estimate',
|
|
||||||
viewReceiptButtonUrl,
|
|
||||||
|
|
||||||
// # Message
|
// # Message
|
||||||
message = '',
|
message = '',
|
||||||
|
|
||||||
@@ -87,9 +79,11 @@ export const ReceiptEmailTemplate: React.FC<
|
|||||||
<Row>
|
<Row>
|
||||||
<Heading style={invoiceCompanyNameStyle}>{companyName}</Heading>
|
<Heading style={invoiceCompanyNameStyle}>{companyName}</Heading>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Text style={amountStyle}>{total}</Text>
|
<Text style={amountStyle}>{total}</Text>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Text style={receiptNumberStyle}>
|
<Text style={receiptNumberStyle}>
|
||||||
{receiptNumberLabel?.replace('{receiptNumber}', receiptNumber)}
|
{receiptNumberLabel?.replace('{receiptNumber}', receiptNumber)}
|
||||||
@@ -98,15 +92,6 @@ export const ReceiptEmailTemplate: React.FC<
|
|||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<Text style={messageStyle}>{message}</Text>
|
<Text style={messageStyle}>{message}</Text>
|
||||||
<Button
|
|
||||||
href={viewReceiptButtonUrl}
|
|
||||||
style={{
|
|
||||||
...viewInvoiceButtonStyle,
|
|
||||||
backgroundColor: primaryColor,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{viewReceiptButtonLabel}
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<Section style={totalsSectionStyle}>
|
<Section style={totalsSectionStyle}>
|
||||||
{items.map((item, index) => (
|
{items.map((item, index) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user