MailChannels Pages Plugin

I'm trying to create a simple static site with a contact form using Pages and Functions, however everything I've attempted so far doesn't seem to be working. I've copied the example at https://developers.cloudflare.com/pages/platform/functions/plugins/mailchannels/ exactly, however the deployment is failing and giving me no information as to why it's failed or what I can do to fix it.
6 Replies
Sebastian
SebastianOP2y ago
I lied. It was not exact. For anybody finding this through search in the future, my issue was ReferenceError: context is not defined fixed by actually defining context:
export const onRequest: PagesFunction = (context) => mailChannelsPlugin({
...
})(context);
export const onRequest: PagesFunction = (context) => mailChannelsPlugin({
...
})(context);
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sebastian
SebastianOP2y ago
already figured this out oh, no onrequest is what you export it's called by functions
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sebastian
SebastianOP2y ago
https://github.com/sebastianrasor/www.sebastianrasor.com here's the source code for my site if you're interested
GitHub
GitHub - sebastianrasor/www.sebastianrasor.com
Contribute to sebastianrasor/www.sebastianrasor.com development by creating an account on GitHub.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server