fix: mail services

This commit is contained in:
Ahmed Bouhuolia
2024-11-09 22:23:52 +02:00
parent 94223b6ebf
commit aa7e5d4ae9
15 changed files with 168 additions and 64 deletions

View File

@@ -32,7 +32,7 @@ function EstimateMailDialogFormRoot({
closeDialog,
}) {
const { mutateAsync: sendEstimateMail } = useSendSaleEstimateMail();
const { mailOptions, saleEstimateId, redirectToEstimatesList } =
const { mailOptions, saleEstimateId, } =
useEstimateMailDialogBoot();
const initialValues = transformMailFormToInitialValues(

View File

@@ -25,8 +25,8 @@ export function EstimateMailDialogFormContent({
<Form>
<div className={Classes.DIALOG_BODY}>
<MailNotificationForm
fromAddresses={mailOptions.from_addresses}
toAddresses={mailOptions.to_addresses}
fromAddresses={mailOptions.from_options}
toAddresses={mailOptions.to_options}
/>
<AttachFormGroup name={'attachEstimate'} inline>
<FSwitch name={'attachEstimate'} label={'Attach Estimate'} />

View File

@@ -22,6 +22,7 @@ interface PaymentMailDialogBootProps {
*/
function PaymentMailDialogBoot({
paymentReceiveId,
redirectToPaymentsList,
...props
}: PaymentMailDialogBootProps) {
const { data: mailOptions, isLoading: isMailOptionsLoading } =

View File

@@ -25,8 +25,8 @@ export function PaymentMailDialogFormContent({
<Form>
<div className={Classes.DIALOG_BODY}>
<MailNotificationForm
fromAddresses={mailOptions.from_addresses}
toAddresses={mailOptions.to_addresses}
fromAddresses={mailOptions.from_options}
toAddresses={mailOptions.to_options}
/>
<AttachFormGroup name={'attachPayment'} inline>
<FSwitch name={'attachPayment'} label={'Attach Payment'} />

View File

@@ -25,8 +25,8 @@ export function ReceiptMailDialogFormContent({
<Form>
<div className={Classes.DIALOG_BODY}>
<MailNotificationForm
fromAddresses={mailOptions.from_addresses}
toAddresses={mailOptions.to_addresses}
fromAddresses={mailOptions.from_options}
toAddresses={mailOptions.to_options}
/>
<AttachFormGroup name={'attachReceipt:'} inline>
<FSwitch name={'attachReceipt:'} label={'Attach Receipt'} />

View File

@@ -66,7 +66,7 @@ export function MailNotificationForm({
</FFormGroup>
</HeaderBox>
<MailMessageEditor name={'body'} />
<MailMessageEditor name={'message'} />
</Box>
);
}

View File

@@ -5,7 +5,7 @@ export const initialMailNotificationValues = {
from: [],
to: [],
subject: '',
body: '',
message: '',
};
export interface MailNotificationFormValues {
@@ -26,7 +26,7 @@ export const transformMailFormToRequest = (
};
/**
* Transformes the mail options response values to form initial values.
* Transforms the mail options response values to form initial values.
* @param {any} mailOptions
* @param {MailNotificationFormValues} initialValues
* @returns {MailNotificationFormValues}