feat(cloudflare): add Send Email support to Worker#1315
feat(cloudflare): add Send Email support to Worker#1315harshil1712 wants to merge 2 commits intoalchemy-run:mainfrom
Conversation
commit: |
john-royal
left a comment
There was a problem hiding this comment.
Looks like a great start. Mind if I take it from here?
| tail_consumers: props.tailConsumers?.map((consumer) => | ||
| isWorker(consumer) ? { service: consumer.name } : consumer, | ||
| ), | ||
| send_email: props.sendEmail?.map((config) => ({ |
There was a problem hiding this comment.
Is this always at the top level instead of under bindings?
I understand it's at the top level in a wrangler.jsonc but the API docs seem to indicate this goes in the bindings array of the worker metadata object (link).
There was a problem hiding this comment.
Yes, it is at the top level. The API might change, I am not 100% sure.
There was a problem hiding this comment.
Were you able to run these? No problem if not, just wondering
There was a problem hiding this comment.
It was missing the remote flag. I have now added that. Will test, and let you know.
alchemy/src/cloudflare/worker.ts
Outdated
| /** | ||
| * Restrict emails to a single destination address (mutually exclusive with allowedDestinationAddresses) | ||
| */ | ||
| destinationAddress?: string; | ||
|
|
||
| /** | ||
| * Allowlist of destination addresses (mutually exclusive with destinationAddress) | ||
| */ | ||
| allowedDestinationAddresses?: string[]; |
There was a problem hiding this comment.
This is a bit of a nitpick but generally if properties are mutually exclusive, we like to model that at the type level.
| }>; | ||
| }>( | ||
| `get worker "${name}"`, | ||
| api.get(`/accounts/${api.accountId}/workers/workers/${name}`), |
There was a problem hiding this comment.
Love to see the new Workers API being used!
|
Appreciate the contribution but going to have to close this for now. I'll incorporate what you've done into #1319 and make sure you're credited as well. Just a note: in Alchemy, any bindings should always be defined in Happy to discuss further here or in Slack/Discord. |
No description provided.