← Cloudflare Email Service / email-service / configuration
Konfigurace send bindings
Když přidáte send_email binding k Workeru můžete omezit, ze kterých a na které adresy smí odesílat. Tato omezení nakonfigurujete v konfiguračním souboru Wrangler. Popis samotného binding API najdete v Workers API.
Typy bindingů
Každá položka v send_email lze nakonfigurovat tak, aby omezovalo, co binding smí dělat. Adresa odesílatele musí vždy patřit doméně, kterou jste zaregistrovali do Email Service.
- Bez atributu omezení: Binding může odesílat na jakoukoli ověřenou cílovou adresu ve vašem účtu.
destination_address: Binding může odesílat pouze na jedinou cílovou adresu nastavenou zde. Pokud zavolátesend()hodnotoutonastaveno nanullneboundefined, použije se nakonfigurovaná adresa.allowed_destination_addresses: Binding může odesílat pouze na adresy uvedené na tomto seznamu povolených adres.allowed_sender_addresses: Binding může odesílat pouze z adres uvedených na tomto seznamu povolených adres.
{
"send_email": [
// Send to any verified destination
{ "name": "EMAIL" },
// Send only to a single fixed destination
{
"name": "NOTIFY_OPS",
"destination_address": "[email protected]",
},
// Send only to addresses on an allowlist
{
"name": "EMAIL_TEAM",
"allowed_destination_addresses": [
"[email protected]",
"[email protected]",
],
},
// Send only from addresses on an allowlist
{
"name": "RESTRICTED_EMAIL",
"allowed_sender_addresses": [
"[email protected]",
"[email protected]",
],
},
],
}[[send_email]]
name = "EMAIL"
[[send_email]]
name = "NOTIFY_OPS"
destination_address = "[email protected]"
[[send_email]]
name = "EMAIL_TEAM"
allowed_destination_addresses = [ "[email protected]", "[email protected]" ]
[[send_email]]
name = "RESTRICTED_EMAIL"
allowed_sender_addresses = [ "[email protected]", "[email protected]" ]Další kroky
- Workers API : odesílání e-mailů z Workeru pomocí vazby.
- Konfigurace domény : zprovoznění domén, ze kterých odesíláte.