Skip to content

mgmgprndev/CloudflareEmailWorker_AutoReply

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CloudflareEmailWorker_AutoReply

Cloudflare Email Worker Auto Reply Example

Setting up your environment

Run Following Commands:

npm install -g wrangler
wrangler login
wrangler generate email-worker-auto-reply

Then It will ask:

✨ Created email-worker-auto-reply/wrangler.toml
✔ No package.json found. Would you like to create one? … 

Answer YES.

✨ Created email-worker-auto-reply/package.json
✔ Would you like to use TypeScript? … no

Answer NO.

? Would you like to create a Worker at email-worker-auto-reply/src/index.js? › - Use arrow-keys. Return to submit.
    None
    Fetch handler
❯   Scheduled handler

Select Scheduled handler.

✔ Would you like us to write your first test? … no

Answer NO. Then move to created directory, and move again to the src/.

cd email-worker-auto-reply
cd src

Now you can code your project by modifying index.js.

To use Mimetype, please write this to wrangler.toml.

compatibility_flags = [ "nodejs_compat" ]

And run this:

npm install mimetext

Also If you wanna use Worker Logs, Then write these too

[observability.logs]
enabled = true
invocation_logs = false

And after you coded, deploy time!!!

npm run deploy

THAT'S IT!

Please go to Cloudflare Dashboard and configure your Email worker Route. Ensure your address will route to the worker you have deployed.

Open your domain's Email > EmailRouting cloudflare email route rule

Click "Create Address" (It also works for Catch-All Address too!) And fill out form like this: rule creating

Click "Save" and if created successfully It will be like this: rule created successfully

Try sending email to [email protected] and see: email

If not recevied? Check Spam Folder!

About

Cloudflare Email Worker Auto Reply Example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published