Last active
July 30, 2023 06:19
-
-
Save sam-heller/a6569c68acc89611da28580445bf983b to your computer and use it in GitHub Desktop.
Split forward for Cloudflare email worker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
async email(message, env, ctx) { | |
const forwardList = ["one@one.com", "two@two.com"]; | |
if (forwardList.indexOf(message.headers.get("from")) != -1) { | |
await message.forward("three@three.com") | |
} | |
await message.forward("four@four.com"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment