Reply to an email in @std/email with headers #142
Replies: 3 comments
-
Yeah I think the A cool API would also be if I could do something like this: import { email } from "https://esm.town/v/std/email";
export default async function(e: Email) {
e.reply({ text: "Pong!" });
} |
Beta Was this translation helpful? Give feedback.
-
Would be nice to be able to get the headers from an export default async function(e: Email) {
console.log(e.headers);
} Would log the headers of any email sent to that val. |
Beta Was this translation helpful? Give feedback.
-
👍 We now support setting headers in emails that you send! Quick val example: import { email } from "https://esm.town/v/std/email?v=13"
console.log(
await email({
text: "Hi",
headers: {
"X-Custom-Header": "xxx",
},
}),
) Also documented in the REST API, and supported in the SDK: https://docs.val.town/openapi#/tag/emails/POST/v1/email |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature request from @wilhelmklopp - the goal is to be able to reply to an email received by an email handler in a way that email clients thread it. I've been able to see this happen sometimes but not on this one, for example.
Seems like the proper solution (according to chatgpt) is to be able to pass headers to sendgrid, which std/email doesn't currently allow. Maybe we should allow a longer list of such headers as well as these.
Beta Was this translation helpful? Give feedback.
All reactions