Skip to content

feat(cloudflare): add Send Email support to Worker#1315

Closed
harshil1712 wants to merge 2 commits intoalchemy-run:mainfrom
harshil1712:main
Closed

feat(cloudflare): add Send Email support to Worker#1315
harshil1712 wants to merge 2 commits intoalchemy-run:mainfrom
harshil1712:main

Conversation

@harshil1712
Copy link

No description provided.

@john-royal john-royal self-assigned this Feb 5, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/alchemy-run/alchemy@1315

commit: 9ad8f6b

Copy link
Collaborator

@john-royal john-royal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) => ({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is at the top level. The API might change, I am not 100% sure.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you able to run these? No problem if not, just wondering

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was missing the remote flag. I have now added that. Will test, and let you know.

Comment on lines +626 to +634
/**
* Restrict emails to a single destination address (mutually exclusive with allowedDestinationAddresses)
*/
destinationAddress?: string;

/**
* Allowlist of destination addresses (mutually exclusive with destinationAddress)
*/
allowedDestinationAddresses?: string[];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}`),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love to see the new Workers API being used!

@john-royal
Copy link
Collaborator

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 WorkerProps["bindings"] - this ensures consistency and lets us infer the type of your env object, which is important to us (Alchemy favors inference over codegen as a design tenet).

Happy to discuss further here or in Slack/Discord.

@john-royal john-royal closed this Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants