Resolved email CC error IO-618

This commit is contained in:
Patrick Fic
2021-02-02 21:31:48 -08:00
parent 2ddaad3e2b
commit b1a2134dd3
3 changed files with 13 additions and 8 deletions

View File

@@ -28,14 +28,14 @@ export default function EmailOverlayComponent({
<Select
value={messageOptions.cc}
mode="tags"
onChange={handleConfigChange}
onChange={(value) => handleConfigChange("cc", value)}
name="cc"
tokenSeparators={[",", ";"]}
/>
Subject:
<Input
value={messageOptions.subject}
onChange={handleConfigChange}
onChange={(e) => handleConfigChange("subject", e.target.value)}
name="subject"
/>
<div style={{ color: "red" }}>

View File

@@ -82,8 +82,7 @@ export function EmailOverlayContainer({
setSending(false);
};
const handleConfigChange = (event) => {
const { name, value } = event.target;
const handleConfigChange = (name, value) => {
setMessageOptions({ ...messageOptions, [name]: value });
};
const handleHtmlChange = (text) => {

View File

@@ -31,10 +31,16 @@ exports.sendEmail = async (req, res) => {
Email: req.body.from.address,
Name: req.body.from.name,
},
To: req.body.to.map((i) => {
return { Email: i };
}),
To:
req.body.to &&
req.body.to.map((i) => {
return { Email: i };
}),
CC:
req.body.cc &&
req.body.cc.map((i) => {
return { Email: i };
}),
ReplyTo: {
Email: req.body.from.address,
Name: req.body.from.name,