Skip to content
GitHubXDiscord

EmailAddress

Manage destination email addresses that can receive emails forwarded by Cloudflare email routing rules.

Add a destination email address:

import { EmailAddress } from "alchemy/cloudflare";
await EmailAddress("admin-email", {
email: "admin@company.com",
});

Create multiple destination addresses for different purposes:

import { EmailAddress } from "alchemy/cloudflare";
const supportEmail = await EmailAddress("support-email", {
email: "support@company.com",
});
const salesEmail = await EmailAddress("sales-email", {
email: "sales@company.com",
});
const adminEmail = await EmailAddress("admin-email", {
email: "admin@company.com",
});

Email addresses must be verified before they can receive forwarded emails:

import { EmailAddress } from "alchemy/cloudflare";
const emailAddress = await EmailAddress("my-email", {
email: "destination@company.com",
});
// Check verification status
console.log(`Verified: ${emailAddress.verified}`);

Handle email addresses with special characters:

import { EmailAddress } from "alchemy/cloudflare";
await EmailAddress("special-email", {
email: "user+tag@example.com",
});
await EmailAddress("subdomain-email", {
email: "admin@subdomain.example.com",
});
  • email (string): Destination email address for routing
  • verified (boolean, optional): Whether to automatically verify the email address if possible. Note: Verification typically requires email confirmation by the recipient. Defaults to false
  • email (string): The email address
  • verified (boolean): Whether the email address has been verified
  • created (string): When the email address was created
  • modified (string): When the email address was last modified
  • tag (string): Email address tag
  1. Create Address: When you create an EmailAddress resource, it’s added to your account but starts unverified
  2. Verification Email: Cloudflare sends a verification email to the destination address
  3. User Confirms: The recipient must click the verification link in the email
  4. Address Verified: Once verified, the address can receive forwarded emails

Destination addresses are used in email routing rules:

import { EmailAddress, EmailRule } from "alchemy/cloudflare";
const adminEmail = await EmailAddress("admin-email", {
email: "admin@company.com",
});
await EmailRule("admin-forwarding", {
zone: "example.com",
name: "Forward admin emails",
matchers: [
{
type: "literal",
field: "to",
value: "admin@example.com",
},
],
actions: [
{
type: "forward",
value: [adminEmail.email],
},
],
});
  • Verify Quickly: Ask recipients to check their email and verify addresses promptly
  • Use Descriptive Names: Use clear resource names that indicate the address purpose
  • Monitor Status: Check verification status before setting up routing rules
  • Trust Recipients: Only add email addresses you trust to receive forwarded emails
  • Review Regularly: Periodically review and remove unused destination addresses
  • Limit Access: Consider who has access to destination addresses in your organization
  • Email addresses must be verified before they can receive forwarded emails
  • Verification requires action from the email recipient
  • Some email providers may block or filter forwarded emails
  1. Check Verification: Ensure the address is verified
  2. Check Spam Folder: Verification emails might be in spam
  3. Retry Verification: Delete and recreate the address if needed
  1. Check Email Provider: Some providers block automated emails
  2. Try Different Address: Use an alternative email address if possible
  3. Contact Support: Reach out to Cloudflare support for assistance