Skip to content

Commit f434b00

Browse files
committed
PCX Review
1 parent 7eba9e6 commit f434b00

25 files changed

Lines changed: 194 additions & 151 deletions

src/content/docs/email-service/api/route-emails/email-handler.mdx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Process incoming emails using the `email()` handler in your Cloudflare Workers.
1515

1616
Add the `email` handler function to your Worker's exported handlers:
1717

18-
```typescript
18+
```ts
1919
interface Env {
2020
EMAIL: SendEmail;
2121
}
@@ -36,11 +36,11 @@ export default {
3636
| `env` | `object` | Worker environment bindings (KV, EMAIL, etc.) |
3737
| `ctx` | `object` | Execution context with `waitUntil` function |
3838

39-
## ForwardableEmailMessage interface
39+
## `ForwardableEmailMessage` interface
4040

4141
The `message` parameter provides access to the incoming email:
4242

43-
```typescript
43+
```ts
4444
interface ForwardableEmailMessage {
4545
readonly from: string; // Sender email address (envelope MAIL FROM)
4646
readonly to: string; // Recipient email address (envelope RCPT TO)
@@ -61,7 +61,7 @@ interface ForwardableEmailMessage {
6161
<Tabs>
6262
<TabItem label="Basic properties">
6363

64-
```typescript
64+
```ts
6565
export default {
6666
async email(message, env, ctx): Promise<void> {
6767
// Access email metadata
@@ -84,7 +84,7 @@ export default {
8484
</TabItem>
8585
<TabItem label="Reading content">
8686

87-
```typescript
87+
```ts
8888
export default {
8989
async email(message, env, ctx): Promise<void> {
9090
// Read raw email content
@@ -115,7 +115,7 @@ export default {
115115
</TabItem>
116116
<TabItem label="Parse email content">
117117

118-
```typescript
118+
```ts
119119
// Helper function to parse email content
120120
async function parseEmailContent(
121121
message,
@@ -177,7 +177,7 @@ Forward incoming emails to verified destination addresses:
177177
<Tabs>
178178
<TabItem label="Simple forwarding">
179179

180-
```typescript
180+
```ts
181181
export default {
182182
async email(message, env, ctx): Promise<void> {
183183
// Forward to a single address
@@ -189,7 +189,7 @@ export default {
189189
</TabItem>
190190
<TabItem label="Conditional forwarding">
191191

192-
```typescript
192+
```ts
193193
export default {
194194
async email(message, env, ctx): Promise<void> {
195195
const recipient = message.to;
@@ -213,7 +213,7 @@ export default {
213213
</TabItem>
214214
<TabItem label="Multiple forwarding">
215215

216-
```typescript
216+
```ts
217217
export default {
218218
async email(message, env, ctx): Promise<void> {
219219
const subject = message.headers.get("subject") || "";
@@ -239,7 +239,7 @@ export default {
239239

240240
Add custom headers when forwarding:
241241

242-
```typescript
242+
```ts
243243
export default {
244244
async email(message, env, ctx): Promise<void> {
245245
// Create custom headers
@@ -262,7 +262,7 @@ Send automatic replies using the Email Service binding:
262262
<Tabs>
263263
<TabItem label="Simple auto-reply">
264264

265-
```typescript
265+
```ts
266266
interface Env {
267267
EMAIL: SendEmail;
268268
}
@@ -293,7 +293,7 @@ export default {
293293
</TabItem>
294294
<TabItem label="Smart auto-reply">
295295

296-
```typescript
296+
```ts
297297
export default {
298298
async email(message, env, ctx): Promise<void> {
299299
const sender = message.from;
@@ -357,7 +357,7 @@ Reject emails with a permanent SMTP error:
357357
<Tabs>
358358
<TabItem label="Simple rejection">
359359

360-
```typescript
360+
```ts
361361
export default {
362362
async email(message, env, ctx): Promise<void> {
363363
const sender = message.from;
@@ -380,7 +380,7 @@ export default {
380380
</TabItem>
381381
<TabItem label="Content-based rejection">
382382

383-
```typescript
383+
```ts
384384
export default {
385385
async email(message, env, ctx): Promise<void> {
386386
const subject = message.headers.get("subject") || "";
@@ -416,7 +416,7 @@ export default {
416416

417417
Handle errors gracefully in email processing:
418418

419-
```typescript
419+
```ts
420420
export default {
421421
async email(message, env, ctx): Promise<void> {
422422
try {

src/content/docs/email-service/api/send-emails/rest-api.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar:
77

88
import { Tabs, TabItem } from "~/components";
99

10-
The REST API allows you to send emails from any application using standard HTTP requests. Use it from any backend, serverless function, or CI/CD pipeline — no Cloudflare Workers binding required.
10+
The REST API allows you to send emails from any application using standard HTTP requests. Use it from any backend, serverless function, or CI/CD pipeline — no Cloudflare Workers binding is required.
1111

1212
For the full OpenAPI specification, refer to the [Email Sending API reference](https://developers.cloudflare.com/api/resources/email_sending/methods/send).
1313

@@ -143,9 +143,9 @@ A successful response returns the delivery status for each recipient:
143143
}
144144
```
145145

146-
- `delivered` - Email addresses to which the message was delivered immediately.
147-
- `permanent_bounces` - Email addresses that permanently bounced.
148-
- `queued` - Email addresses for which delivery was queued for later.
146+
- `delivered` - Email addresses to which the message was delivered immediately
147+
- `permanent_bounces` - Email addresses that permanently bounced
148+
- `queued` - Email addresses for which delivery was queued for later
149149

150150
## Error handling
151151

src/content/docs/email-service/api/send-emails/workers-api.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ allowed_sender_addresses = ["noreply@yourdomain.com", "support@yourdomain.com"]
2727

2828
</WranglerConfig>
2929

30-
## send() method
30+
## `send()` method
3131

3232
Send a single email using the `send()` method on your email binding.
3333

3434
### Interface
3535

36-
```typescript
36+
```ts
3737
interface SendEmail {
3838
send(message: EmailMessage | EmailMessageBuilder): Promise<EmailSendResult>;
3939
}
@@ -73,7 +73,7 @@ interface EmailSendResult {
7373
<Tabs>
7474
<TabItem label="Simple email">
7575

76-
```typescript
76+
```ts
7777
interface Env {
7878
EMAIL: SendEmail;
7979
}
@@ -82,7 +82,7 @@ interface Env {
8282
</TabItem>
8383
<TabItem label="Multiple recipients">
8484

85-
```typescript
85+
```ts
8686
// Send to multiple recipients (max 50)
8787
const response = await env.EMAIL.send({
8888
to: ["user1@example.com", "user2@example.com", "user3@example.com"],
@@ -96,7 +96,7 @@ const response = await env.EMAIL.send({
9696
</TabItem>
9797
<TabItem label="With CC and BCC">
9898

99-
```typescript
99+
```ts
100100
const response = await env.EMAIL.send({
101101
to: "customer@example.com",
102102
cc: ["manager@company.com"],
@@ -117,7 +117,7 @@ const response = await env.EMAIL.send({
117117
<Tabs>
118118
<TabItem label="PDF attachment">
119119

120-
```typescript
120+
```ts
121121
const response = await env.EMAIL.send({
122122
to: "customer@example.com",
123123
from: "invoices@yourdomain.com",
@@ -137,7 +137,7 @@ const response = await env.EMAIL.send({
137137
</TabItem>
138138
<TabItem label="Inline image">
139139

140-
```typescript
140+
```ts
141141
const response = await env.EMAIL.send({
142142
to: "user@example.com",
143143
from: "marketing@yourdomain.com",
@@ -169,7 +169,7 @@ Handle email sending errors gracefully:
169169
<Tabs>
170170
<TabItem label="Single send errors">
171171

172-
```typescript
172+
```ts
173173
export default {
174174
async fetch(request: Request, env: Env): Promise<Response> {
175175
try {
@@ -253,11 +253,11 @@ The following error codes may be returned when sending emails:
253253
| `E_HEADERS_TOO_LARGE` | Headers payload too large | Total custom headers exceed 16 KB limit |
254254
| `E_HEADERS_TOO_MANY` | Too many headers | More than 20 whitelisted (non-X) custom headers |
255255

256-
## Legacy EmailMessage API
256+
## Legacy `EmailMessage` API
257257

258-
The existing EmailMessage API remains supported for backward compatibility:
258+
The existing `EmailMessage` API remains supported for backward compatibility:
259259

260-
```typescript
260+
```ts
261261
import { EmailMessage } from "cloudflare:email";
262262
import { createMimeMessage } from "mimetext";
263263

@@ -286,7 +286,7 @@ export default {
286286

287287
---
288288

289-
**Next steps:**
289+
## Next steps
290290

291291
- See the [REST API](/email-service/api/send-emails/rest-api/) for sending emails without Workers
292292
- See [practical examples](/email-service/examples/) of email sending patterns

src/content/docs/email-service/concepts/deliverability.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66
order: 3
77
---
88

9-
import VerifiedEmails from "~/content/partials/email-service/_sandboxing.mdx";
9+
import {DashButton, Render} from "~/components";
1010

1111
Email deliverability ensures your emails reach recipients' inboxes. Cloudflare Email Service handles bounces automatically and manages sender reputation to maximize delivery success.
1212

@@ -37,7 +37,7 @@ Soft bounces are temporary failures that may succeed if retried:
3737

3838
Cloudflare automatically retries soft bounces with exponential backoff over an extended period.
3939

40-
<VerifiedEmails />
40+
<Render file="sandboxing" product="email-service" />
4141

4242
## Reputation management
4343

src/content/docs/email-service/concepts/email-authentication.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SPF works by:
2727

2828
## DKIM (DomainKeys Identified Mail)
2929

30-
DKIM ensures that emails haven't been tampered with during transit by cryptographically signing them with your domain's private key.
30+
DKIM ensures that emails have not been tampered during transit by cryptographically signing them with your domain's private key.
3131

3232
**How DKIM works:**
3333

src/content/docs/email-service/concepts/email-lifecycle.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ flowchart LR
3636
- **SPF (Sender Policy Framework)**: Verifies that the sending IP address is authorized to send emails for the domain by checking DNS TXT records. This prevents domain spoofing and improves deliverability.
3737
- **DKIM (DomainKeys Identified Mail)**: Validates the email's cryptographic signature to ensure message integrity and authenticate the sender domain. This builds trust with recipient servers.
3838
- **DMARC (Domain-based Message Authentication)**: Applies domain owner policies for handling emails that fail SPF or DKIM checks, helping prevent phishing and brand impersonation while providing feedback reports.
39-
39+
4040
These authentication mechanisms work together to establish sender legitimacy and protect against email fraud. Senders with low reputation scores may experience throttling or delayed processing.
4141

4242
4. **Suppression list check:** The system checks the recipient against global suppression lists that include bounces, complaints, and unsubscribes. Recipients found on these lists are blocked from receiving the email.

src/content/docs/email-service/concepts/suppressions.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar:
99

1010
import { Tabs, TabItem } from "~/components";
1111

12-
Suppression lists prevent emails from being sent to addresses that shouldn't receive them, protecting your sender reputation and ensuring compliance with anti-spam regulations.
12+
Suppression lists prevent emails from being sent to addresses that should not receive them, protecting your sender reputation and ensuring compliance with anti-spam regulations.
1313

1414
## Suppression lists
1515

@@ -41,7 +41,7 @@ Cloudflare will automatically add email addresses to your account suppression li
4141

4242
You may also manually add or remove email addresses from your suppression list as needed. The removal of email addresses that have been automatically added to your suppression list as a result of a spam complaint is limited to avoid abuse.
4343

44-
## How does Email Service's automatic suppression work
44+
## Automatic suppression logic
4545

4646
Cloudflare automatically suppresses addresses that:
4747

src/content/docs/email-service/configuration/domains.mdx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,10 @@ Removing a domain will:
379379

380380
### Domain status indicators
381381

382-
- **🟢 Active**: All records configured correctly
383-
- **🟡 Warning**: Some records missing or misconfigured
384-
- **🔴 Error**: Critical configuration issues
385-
- **Pending**: DNS propagation in progress
382+
- **Active**: All records configured correctly
383+
- **Warning**: Some records missing or misconfigured
384+
- **Error**: Critical configuration issues
385+
- **Pending**: DNS propagation in progress
386386

387387
### Automated monitoring
388388

@@ -421,17 +421,15 @@ async function checkDomainHealth(domain: string): Promise<boolean> {
421421

422422
Proper domain configuration is essential for Email Service functionality:
423423

424-
- **DNS records** enable sending and routing
425-
- **Verification** ensures proper setup
426-
- **Advanced settings** provide flexibility and security
427-
- **Monitoring** maintains domain health
424+
- DNS records enable sending and routing
425+
- Verification ensures proper setup
426+
- Advanced settings provide flexibility and security
427+
- Monitoring maintains domain health
428428

429429
## Next steps
430430

431431
- **[Send emails API](/email-service/api/send-emails/)**: Workers binding and REST API reference
432432
- **[Domain authentication (DKIM and SPF)](/email-service/concepts/email-authentication/)**: Learn about SPF, DKIM, and DMARC
433433
- **[Deliverability](/email-service/concepts/deliverability/)**: Optimize email delivery
434434

435-
---
436435

437-
_Need help with domain configuration?_ Contact support.

src/content/docs/email-service/configuration/email-routing-addresses.mdx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ sidebar:
55
order: 1
66
---
77

8+
import {DashButton} from "~/components";
9+
810
In Email routing, an email rule is a pair of a custom email address and a destination address, or a custom email address and an associated Worker. You can route emails to either:
911

1012
- Verified email addresses
@@ -16,6 +18,9 @@ This allows you to route emails to your preferred inbox, or apply logic with Wor
1618

1719
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain.
1820
2. Go to **Email** > **Email Routing** > **Routes**.
21+
22+
<DashButton url="/?to=/:account/email-service/routing" />
23+
1924
3. Select **Create address**.
2025
4. In **Custom address**, enter the custom email address you want to use (for example, `my-new-email`).
2126
5. In the **Action** drop-down menu, choose what this email rule should do. Refer to [Email rule actions](#email-rule-actions) for more information.
@@ -42,16 +47,22 @@ To prevent spamming unintended recipients, all email rules are automatically dis
4247

4348
### Disable an email rule
4449

45-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain.
46-
2. Go to **Email** > **Email Routing** > **Routes**.
50+
1. In the Cloudflare dashboard, go to **Email Routing**.
51+
52+
<DashButton url="/?to=/:account/email-service/routing" />
53+
54+
2. Select **Routes**.
4755
3. In **Custom addresses**, identify the email rule you want to pause, and toggle the status button to **Disabled**.
4856

4957
Your email rule is now disabled. It will not forward emails to a destination address or Worker. To forward emails again, toggle the email rule status button to **Active**.
5058

5159
### Edit custom addresses
5260

53-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain.
54-
2. Go to **Email** > **Email Routing** > **Routes**.
61+
1. In the Cloudflare dashboard, go to **Email Routing**.
62+
63+
<DashButton url="/?to=/:account/email-service/routing" />
64+
65+
2. Select **Routes**.
5566
3. In **Custom addresses**, identify the email rule you want to edit, and select **Edit**.
5667
4. Make the appropriate changes to this custom address.
5768

@@ -61,8 +72,11 @@ When you enable this feature, Email Routing will catch variations of email addre
6172

6273
To enable Catch-all addresses:
6374

64-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain.
65-
2. Go to **Email** > **Email Routing** > **Routes**.
75+
1. In the Cloudflare dashboard, go to **Email Routing**.
76+
77+
<DashButton url="/?to=/:account/email-service/routing" />
78+
79+
2. Select **Routes**.
6680
3. Enable **Catch-all address**, so it shows as **Active**.
6781
4. In the **Action** drop-down menu, select what to do with these emails. Refer to [Email rule actions](#email-rule-actions) for more information.
6882
5. Select **Save**.

0 commit comments

Comments
 (0)