Skip to content

Commit f99f6fd

Browse files
committed
feat: add docs about Cloudflare Email Support
1 parent 5edd637 commit f99f6fd

5 files changed

Lines changed: 151 additions & 1 deletion

File tree

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
title: How to send email with Cloudflare Email
3+
description: How to send transactional email notifications with Cloudflare Email Service and Knock.
4+
tags: ["cloudflare", "email", "email service", "transactional"]
5+
section: Integrations > Email
6+
layout: integrations
7+
---
8+
9+
Knock supports using <a href="https://developers.cloudflare.com/email-service/get-started/send-emails/" target="_blank" rel="noopener noreferrer">Cloudflare Email Service</a> to send email notifications to your users.
10+
11+
<Callout
12+
type="info"
13+
title="Cloudflare DNS required"
14+
text={
15+
<>
16+
Cloudflare Email Service requires your domain's DNS to be configured
17+
correctly on Cloudflare. See{" "}
18+
<a
19+
href="https://developers.cloudflare.com/email-service/configuration/domains/"
20+
target="_blank"
21+
rel="noopener noreferrer"
22+
>
23+
Email Service domain configuration
24+
</a>{" "}
25+
for DNS record details.
26+
</>
27+
}
28+
/>
29+
30+
## Features
31+
32+
- Knock link and open tracking
33+
- Per environment configuration
34+
- Sandbox mode
35+
36+
## Getting started
37+
38+
1. In the Cloudflare dashboard, create an **API token** (or use a compatible **API key**) with permission to send email for your account, and copy your Cloudflare **account ID**. See Cloudflare's <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/" target="_blank" rel="noopener noreferrer">API token documentation</a> and <a href="https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/" target="_blank" rel="noopener noreferrer">how to find your account ID</a>.
39+
2. In Knock, open **Channels and sources** in your account settings and create a **Cloudflare Email** channel.
40+
3. For each [environment](/concepts/environments), open **Manage configuration** on the channel and enter your **Account ID** and **API key** (your Cloudflare API token or key), plus your default **From** address and optional **From** name. Use addresses on domains you have verified for sending in Cloudflare.
41+
42+
## Channel configuration
43+
44+
The following channel settings should be configured per [environment](/concepts/environments). Navigate to **Channels and sources** in your dashboard account settings, select your Cloudflare Email [channel](/concepts/channels), then click "Manage configuration" under the environment that you'd like to configure.
45+
46+
<AccordionGroup>
47+
<Accordion title="Settings">
48+
Fields marked with an `*` are required.
49+
50+
**Knock settings**
51+
<Attributes>
52+
<Attribute
53+
name="Sandbox mode"
54+
type="boolean"
55+
nameSlug="/integrations/overview#sandbox-mode"
56+
description="Whether to enable sandbox mode for your Cloudflare Email channel."
57+
/>
58+
<Attribute
59+
name="Knock open tracking"
60+
nameSlug="/send-notifications/tracking#email-open-tracking"
61+
type="boolean"
62+
description="Whether to enable Knock email-open tracking."
63+
/>
64+
<Attribute
65+
name="Knock link tracking"
66+
nameSlug="/send-notifications/tracking#link-click-tracking"
67+
type="boolean"
68+
description="Whether to enable Knock link-click tracking."
69+
/>
70+
</Attributes>
71+
72+
**Provider settings for Cloudflare Email**
73+
<Attributes>
74+
<Attribute
75+
name="Account ID"
76+
type="string*"
77+
description="Your Cloudflare account ID. Used with Cloudflare's email sending API."
78+
/>
79+
<Attribute
80+
name="API key"
81+
type="string*"
82+
description="Your Cloudflare API token or API key with permission to send email for this account."
83+
/>
84+
<Attribute
85+
name="From email address"
86+
type="string | liquid*"
87+
description="The default sender email address (can use Liquid tags). Must use a domain you have configured for sending in Cloudflare."
88+
/>
89+
<Attribute
90+
name="From name"
91+
type="string | liquid"
92+
description="The default sender name (can use Liquid tags)."
93+
/>
94+
</Attributes>
95+
96+
</Accordion>
97+
<Accordion title="Overrides">
98+
When configured, these optional overrides will apply to all emails sent from this channel in the configured environment. See [Settings and overrides](/integrations/email/settings) for more on email channel overrides.
99+
100+
<Attributes>
101+
<Attribute
102+
name="To"
103+
type="string | liquid"
104+
description="The To email address that email notifications will be sent to (can use Liquid tags). This value will override the designated recipient's email address."
105+
/>
106+
<Attribute
107+
name="Cc"
108+
type="string | liquid"
109+
description="The CC email address that email notifications will be sent to (can use Liquid tags)."
110+
/>
111+
<Attribute
112+
name="Bcc"
113+
type="string | liquid"
114+
description="The BCC email address that email notifications will be sent to (can use Liquid tags)."
115+
/>
116+
<Attribute
117+
name="Reply-to"
118+
type="string | liquid"
119+
description="The reply-to email address that will be included on email notifications (can use Liquid tags)."
120+
/>
121+
<Attribute
122+
name="Payload overrides"
123+
nameSlug="/integrations/email/settings#provider-json-overrides"
124+
type="JSON (string) | liquid"
125+
description="Provide a JSON object to merge into the API payload that is sent to the downstream provider."
126+
/>
127+
</Attributes>
128+
129+
</Accordion>
130+
<Accordion title="Conditions">
131+
Set optional per-environment [conditions](/integrations/overview#channel-conditions) for this channel. These conditions are evaluated each time a workflow run encounters a step that uses this channel in the configured environment. If the conditions are not met, the step will be skipped.
132+
</Accordion>
133+
</AccordionGroup>
134+
135+
## Recipient data requirements
136+
137+
To send an email notification you'll need a valid `email` property set on your recipient.

content/integrations/email/overview.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ Knock currently supports sending email notifications to the following email prov
4848
columnsYes: ["Delivery tracking", "Bounce support"],
4949
columnsNo: ["Provider link and open tracking"],
5050
},
51+
{
52+
name: "Cloudflare Email",
53+
href: "/integrations/email/cloudflare-email",
54+
columnsYes: [],
55+
columnsNo: [
56+
"Delivery tracking",
57+
"Bounce support",
58+
"Provider link and open tracking",
59+
],
60+
},
5161
{
5262
name: "MailerSend",
5363
href: "/integrations/email/mailersend",

content/integrations/overview.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ Here are the providers we currently support within Knock. We're adding more each
134134
### Email
135135

136136
- [Amazon SES](/integrations/email/aws-ses)
137+
- [Cloudflare Email](/integrations/email/cloudflare-email)
137138
- [Knock (test)](/integrations/email/knock-test)
138139
- [Mailersend](/integrations/email/mailersend)
139140
- [Mailgun](/integrations/email/mailgun)

data/sidebars/integrationsSidebar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const INTEGRATIONS_SIDEBAR: SidebarContent[] = [
5151
{ slug: "/client-previews", title: "Client previews" },
5252
{ slug: "/knock-test", title: "Knock test emails" },
5353
{ slug: "/aws-ses", title: "Amazon SES" },
54+
{ slug: "/cloudflare-email", title: "Cloudflare Email" },
5455
{ slug: "/mailersend", title: "MailerSend" },
5556
{ slug: "/mailgun", title: "Mailgun" },
5657
{ slug: "/mailjet", title: "Mailjet" },

lib/typedoc.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export interface TypedocPage {
1414
}
1515

1616
export async function getAllTypedocs() {
17-
const typedocs = await glob("typedocs/**/*.mdx");
17+
const typedocPaths = await glob("typedocs/**/*.mdx");
18+
const typedocs = Array.isArray(typedocPaths) ? typedocPaths : [];
1819

1920
const typedocMdx = await Promise.all(
2021
typedocs.map(async (typedoc): Promise<TypedocPage> => {

0 commit comments

Comments
 (0)