Skip to content

Instantly share code, notes, and snippets.

@SergioRibera
Created August 23, 2024 01:06
Show Gist options
  • Save SergioRibera/6a090e5e2dfa607752661e31b7f53898 to your computer and use it in GitHub Desktop.
Save SergioRibera/6a090e5e2dfa607752661e31b7f53898 to your computer and use it in GitHub Desktop.
Just Forward emails LOL
// Just Forward LOL
export default {
async email(message, env, ctx) {
if (!env.EMAILS || env.EMAILS.split(";").length == 0) {
message.setReject("No mails configured in the `EMAILS` environment variable")
return
}
const allowList = env.EMAILS.split(";")
for (const to of allowList) {
console.log(`Redirecting to ${to}`)
await message.forward(to)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment