CF-Changes Email Service - Email Sending is now available on the Workers Free plan

Cloudflare Reporting - Product Changelog

ENF News Bot

Automated News Bot
Joined
Apr 15, 2022
Messages
4,460
Email Sending is now available on the Workers Free plan for sending to the verified destination addresses in your account.

You can now onboard sending domains, send for free to verified destination addresses during development and testing, and upgrade to the Workers Paid plan when going to production to send to arbitrary addresses. Use the Workers binding, the REST API, or SMTP to send alerts, reports, and notifications to your own team without a paid plan.

Sends to verified destination addresses are free on every plan. They do not count toward the monthly quota or the daily sending limits.

src/index.jsjs

Code:
export default {
	async fetch(request, env) {
		try {
			await env.EMAIL.send({
				from: "alerts@yourdomain.com",
				to: "oncall@example.com", // A verified destination address
				subject: "Disk usage above 90%",
				text: "Disk usage on db-1 is above 90%.",
			});
		} catch (error) {
			if (error.code === "E_RECIPIENT_PLAN_RESTRICTED") {
				return new Response("Recipient is not a verified destination address", {
					status: 403,
				});
			}
			throw error;
		}

		return new Response("Alert sent");
	},
};
src/index.tsts

Code:
export default {
	async fetch(request, env): Promise<Response> {
		try {
			await env.EMAIL.send({
				from: "alerts@yourdomain.com",
				to: "oncall@example.com", // A verified destination address
				subject: "Disk usage above 90%",
				text: "Disk usage on db-1 is above 90%.",
			});
		} catch (error) {
			if (error.code === "E_RECIPIENT_PLAN_RESTRICTED") {
				return new Response("Recipient is not a verified destination address", {
					status: 403,
				});
			}
			throw error;
		}

		return new Response("Alert sent");
	},
} satisfies ExportedHandler<Env>;

To send to any recipient, upgrade to the Workers Paid plan. Refer to Limits and Pricing for details.

Verified sends now appear in Email Sending​

https://developers.cloudflare.com/changelog/rss/#verified-sends-now-appear-in-email-sending

Messages that you send from a sending domain to verified destination addresses now count as Email Sending traffic.

Before, the capability to send to verified destination addresses was an Email Routing feature, and these messages were recorded as Email Routing traffic. This change moves this capability to Email Sending, with support for all Email Sending features:


To find these messages in the GraphQL Analytics API, filter the Email Sending datasets on the new isVerifiedRecipient field. Messages sent from a domain that has only Email Routing configured are unchanged.

Continue reading...
 
Back
Top