1 hour ago · 10 min read1941 words · Tech · hide

A static site cannot send email. So a contact form on an Astro site always needs a second thing: a form service, or an email API with an account, an API key and a monthly limit. That is a lot of setup for a form that sends a few messages a week, all of them to you. Cloudflare’s Email Service takes that second thing away. Today, Cloudflare announced that Email Sending is now available on the Workers Free plan. Sending to a verified destination address in your own account is free on all plans, and those emails do not count toward any quota. A contact form is exactly that: every email goes to you. So today I moved the contact form on this site to it. This post shows how, with the code. What you need This setup is for a static Astro site on Cloudflare Pages, with its DNS at Cloudflare. It has three parts: A form on your Astro page. A Pages Function that receives the form and asks Cloudflare to send the email. Four things on the Cloudflare side: a verified address to send to, a domain to…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town