I'm guessing it's either in the data or in the request, but I'd rather not trying blindly.
Thanks
import mailChannelsPlugin from "@cloudflare/pages-plugin-mailchannels";export const onRequest: PagesFunction = (context) => { var data = context?.data; // <-- That's just a test return mailChannelsPlugin({ personalizations: [ { to: [{ name: "Giulio Zanchetta", email: "giulio.zanchetta@majestico.it" }], dkim_domain: "majestico.it", dkim_selector: "mailchannels", dkim_private_key: context.env.DKIM_PRIVATE_KEY, }, ], from: { name: `${data?.name}`, // <-- Here I want the actual name inserted in the form email: "no-reply@majestico.it", }, respondWith: () => new Response(null, { status: 302, headers: { Location: "/thank-you" }, }), })(context);};
import mailChannelsPlugin from "@cloudflare/pages-plugin-mailchannels";export const onRequest: PagesFunction = (context) => { var data = context?.data; // <-- That's just a test return mailChannelsPlugin({ personalizations: [ { to: [{ name: "Giulio Zanchetta", email: "giulio.zanchetta@majestico.it" }], dkim_domain: "majestico.it", dkim_selector: "mailchannels", dkim_private_key: context.env.DKIM_PRIVATE_KEY, }, ], from: { name: `${data?.name}`, // <-- Here I want the actual name inserted in the form email: "no-reply@majestico.it", }, respondWith: () => new Response(null, { status: 302, headers: { Location: "/thank-you" }, }), })(context);};