Added length of appointment to config + fixed appointments not showing in scheduling modal + added appointment confirmation template. BOD-141 BOD-149 BOD-148
This commit is contained in:
@@ -8,20 +8,21 @@ export default function EmailOverlayComponent({
|
||||
}) {
|
||||
return (
|
||||
<div>
|
||||
To:
|
||||
<Input
|
||||
defaultValue={messageOptions.to}
|
||||
value={messageOptions.to}
|
||||
onChange={handleConfigChange}
|
||||
name="to"
|
||||
/>
|
||||
CC
|
||||
CC:
|
||||
<Input
|
||||
defaultValue={messageOptions.cc}
|
||||
value={messageOptions.cc}
|
||||
onChange={handleConfigChange}
|
||||
name="cc"
|
||||
/>
|
||||
Subject
|
||||
Subject:
|
||||
<Input
|
||||
defaultValue={messageOptions.subject}
|
||||
value={messageOptions.subject}
|
||||
onChange={handleConfigChange}
|
||||
name="subject"
|
||||
/>
|
||||
|
||||
@@ -33,6 +33,7 @@ export function EmailOverlayContainer({
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [sending, setSending] = useState(false);
|
||||
const defaultEmailFrom = {
|
||||
from: {
|
||||
name: bodyshop.shopname || EmailSettings.fromNameDefault,
|
||||
@@ -45,21 +46,19 @@ export function EmailOverlayContainer({
|
||||
html: "",
|
||||
});
|
||||
|
||||
const handleOk = () => {
|
||||
//sendEmail(messageOptions);
|
||||
axios
|
||||
.post("/sendemail", messageOptions)
|
||||
.then((response) => {
|
||||
console.log(JSON.stringify(response));
|
||||
notification["success"]({ message: t("emails.successes.sent") });
|
||||
toggleEmailOverlayVisible();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(JSON.stringify(error));
|
||||
notification["error"]({
|
||||
message: t("emails.errors.notsent", { message: error.message }),
|
||||
});
|
||||
const handleOk = async () => {
|
||||
setSending(true);
|
||||
try {
|
||||
const emailResponse = await axios.post("/sendemail", messageOptions);
|
||||
notification["success"]({ message: t("emails.successes.sent") });
|
||||
toggleEmailOverlayVisible();
|
||||
} catch (error) {
|
||||
console.log(JSON.stringify(error));
|
||||
notification["error"]({
|
||||
message: t("emails.errors.notsent", { message: error.message }),
|
||||
});
|
||||
}
|
||||
setSending(false);
|
||||
};
|
||||
|
||||
const handleConfigChange = (event) => {
|
||||
@@ -72,6 +71,7 @@ export function EmailOverlayContainer({
|
||||
|
||||
const render = async () => {
|
||||
setLoading(true);
|
||||
console.log("emailConfig", emailConfig);
|
||||
let html = await RenderTemplate(emailConfig.template, bodyshop);
|
||||
setMessageOptions({
|
||||
...emailConfig.messageOptions,
|
||||
@@ -93,7 +93,9 @@ export function EmailOverlayContainer({
|
||||
onOk={handleOk}
|
||||
onCancel={() => {
|
||||
toggleEmailOverlayVisible();
|
||||
}}>
|
||||
}}
|
||||
okButtonProps={{ loading: sending }}
|
||||
>
|
||||
<LoadingSpinner loading={loading}>
|
||||
<EmailOverlayComponent
|
||||
handleConfigChange={handleConfigChange}
|
||||
@@ -102,10 +104,10 @@ export function EmailOverlayContainer({
|
||||
/>
|
||||
<button
|
||||
onClick={() => {
|
||||
console.log(messageOptions.html);
|
||||
navigator.clipboard.writeText(messageOptions.html);
|
||||
}}>
|
||||
Get HTML
|
||||
}}
|
||||
>
|
||||
Copy HTML
|
||||
</button>
|
||||
</LoadingSpinner>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user