email worker `send to a worker` - can I select a specific path?

I have a worker which handles a lot of things, it's a hono api backend. Can I send email to a specific endpoint?
2 Replies
Jürgen Leschner
@cosbgn check out this example of an email worker - it includes a fetch handler but not hono. https://github.com/jldec/my-email-worker To extend hono with an email handler, export app.fetch together with your email handler.
const app = new Hono()

export default {
fetch: app.fetch,
email: async (message, env, ctx) => {...}
}
const app = new Hono()

export default {
fetch: app.fetch,
email: async (message, env, ctx) => {...}
}
https://hono.dev/docs/getting-started/cloudflare-workers#using-hono-with-other-event-handlers
cosbgn
cosbgnOP5d ago
Great thank you!

Did you find this page helpful?