sia
sia
CDCloudflare Developers
Created by sia on 8/2/2024 in #workers-discussions
function calling a worker with data
Specifically, how to send data to the worker from the function. It would be nice to await a response from the worker but I could skip that if needed.
2 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
So I think the only action now is to fix that docs page to remove the type attribute
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
Re-verified that functions still don't work because they don't support email.
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
Got it working in the worker.
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
When I remove that field, I no longer get the error. I haven't gotten email to work yet but at least that explains that error. I've only done this from the worker so far, not pages. Can you log a request to fix the example on this page? https://developers.cloudflare.com/email-routing/email-workers/send-email-workers/
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
I'm trying from a regular worker now and getting the same error. Perhaps that docs page is wrong? The first example shows:
send_email = [
{type = "send_email", name = "<NAME_FOR_BINDING>", destination_address = "<YOUR_EMAIL>@example.com"},
]
send_email = [
{type = "send_email", name = "<NAME_FOR_BINDING>", destination_address = "<YOUR_EMAIL>@example.com"},
]
But the latter example shows:
send_email = [
{name = "<NAME_FOR_BINDING1>"},
{name = "<NAME_FOR_BINDING2>", destination_address = "<YOUR_EMAIL>@example.com"},
{name = "<NAME_FOR_BINDING3>", allowed_destination_addresses = ["<YOUR_EMAIL>@example.com", "<YOUR_EMAIL2>@example.com"]},
]
send_email = [
{name = "<NAME_FOR_BINDING1>"},
{name = "<NAME_FOR_BINDING2>", destination_address = "<YOUR_EMAIL>@example.com"},
{name = "<NAME_FOR_BINDING3>", allowed_destination_addresses = ["<YOUR_EMAIL>@example.com", "<YOUR_EMAIL2>@example.com"]},
]
And no type property is in it
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
Just checking in again - does this error mean I can't use email in functions?
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
Does this mean I cannot use send_email in functions? Maybe only in workers?
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
In my wrangler.toml:
[env.production]
send_email = [
{type = "send_email", name = "form_email", destination_address = "[email protected]"},
]
[env.production]
send_email = [
{type = "send_email", name = "form_email", destination_address = "[email protected]"},
]
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
No description
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
going to try dynamic imports
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
import { EmailMessage } from "cloudflare:email"
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
actually i could try to detect the env and just not send, but the problem is the dependencies fail locally
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
i'd expect it to do the same thing as in production. so i can test if my form function actually works. and then add in the spam filtering api
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
lol finally
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
Though at this point I'm not sure I want to do this at all. I'm not comfortable only being able to test in production. Like what's the point of local wrangler dev if the entire thing breaks if I add an email feature
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
Or is it SEB in this line?
await env.SEB.send(message);
await env.SEB.send(message);
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
why can't i find a doc with this info? the name for binding doesn't show up anywhere in the example here https://developers.cloudflare.com/email-routing/email-workers/send-email-workers/
71 replies
CDCloudflare Developers
Created by sia on 7/31/2024 in #functions
emails from functions
Sorry, where's the binding name used in that example? I'm not using typescript, just javascript
71 replies