unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.89k stars 496 forks source link

Request to add cloudflare worker email handler #2480

Closed dalbodeule closed 2 months ago

dalbodeule commented 4 months ago

Describe the feature

The cloudflare worker has a feature that allows email handling by declaring the email function added as beta. I would like to use this feature. However, nitro does not officially support this feature.

Therefore, I hope you will consider using this feature. In addition, I hope that the queue consumer is also well created.

Additional information

dalbodeule commented 3 months ago

I implemented the Email function in my fork's emailTask ​​branck. Is it okay to implement it this way? @pi0

pi0 commented 3 months ago

I think we can simply expose a hook from cloudflare one and allow integrating it since this feature is mostly vendor specific (cloudflare preset calls cloudflare:email(event, context) hook)

dalbodeule commented 3 months ago

cloudflare:email and cloudflare:queue handler is mareged. close this issue!

dalbodeule commented 2 months ago
image

after the chore, "cloudflare:email" and "cloudflare:queue" hook is not detected properly. Could you possibly know a solution to this?

For reference, I also checked the package-lock.json file and confirmed that nitropack 2.9.7 was applied.

dalbodeule commented 2 months ago
image

I placed the plugin in the exact location just in case, but it's still the same. It seems that TypeScript does not recognize the existence of the "cloudflare:email" and "cloudflare:queue" hooks.

dalbodeule commented 2 months ago

issue moved here

zou-yu commented 2 months ago

cloudflare:email and cloudflare:queue handler is mareged. close this issue!

@dalbodeule Good job! Thank you for your contribution!! I really need this feature (email handler)