let sendRequest = new Request("https://api.mailchannels.net/tx/v1/send", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
personalizations: [
{
to: [{ email: "info@example.com" }]
}
],
from: {
email: "web-contactus@example.com"
},
subject: `Contact Us - ${form.lname}, ${form.fname} (${form.subject})`,
content: [
{
type: "text/html",
value: `<h2>Subject: ${form.subject}</h2>
<p style="background-color: lightgray; padding: 10px; max-width: 1250px;">
${form.message}
</p>
<h2><strong>Email: <a href="mailto:${form.email}">${form.email}</a></strong></h2>`
}
]
})
});
let sendRequest = new Request("https://api.mailchannels.net/tx/v1/send", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
personalizations: [
{
to: [{ email: "info@example.com" }]
}
],
from: {
email: "web-contactus@example.com"
},
subject: `Contact Us - ${form.lname}, ${form.fname} (${form.subject})`,
content: [
{
type: "text/html",
value: `<h2>Subject: ${form.subject}</h2>
<p style="background-color: lightgray; padding: 10px; max-width: 1250px;">
${form.message}
</p>
<h2><strong>Email: <a href="mailto:${form.email}">${form.email}</a></strong></h2>`
}
]
})
});