Set reply-to email in Mailchannels api request

Is there a way to set a reply-to email on my mail send worker? People fill in a form and set their email, I then send the form to myself and set their email as a mailto link. I would like to set a reply-to header instead. The relevant code so far looks roughly as such:
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>`
}
]
})
});
1 Reply
Chaika
Chaika12mo ago
From the Mailchannels docs, https://api.mailchannels.net/tx/v1/documentation, there's an object on the personalizations array called reply_to which you can set, with the same properties as from/to