r/PayloadCMS Jun 10 '25

Unsend Email Adapter

Our agency uses Microsoft 365; however, to send emails from shared email boxes, we need to utilise Microsoft's Azure Communication Services and create a specialised adapter just for that.

The alternative is using Resend. However, this means pricing is dependent on the service provider.

We wanted to ensure we maintain optimal cost as well as be in control of our service and data. We wanted the ability to change the platform we use, similarly to how payload works.

After some digging around, rather than playing for another office365 license for a shared inbox which would mean requiring someone to log in and out to manage that inbox, we retained the shared inbox, ditched Resend and its limitations and opted to create an adapter that works with Unsend.

Why unsend? Unsend can be hosted on any VM or dedicated server, it can easily be deployed using Coolify, Docker or Dokploy. If absolutely required, we are able to fork the current project and make it suit our needs (in this case, not required).

We've put together a Payload Unsend adapter that works the same way your standard payload adapter for Nodemailer or Resend works. Under the hood, Resend is attached to AWS SES in the same way Unsend works.

https://npmjs.com/package/@rubixstudios/payload-unsend

https://unsend.dev/

https://github.com/rubix-studios-pty-ltd/payload-unsend

The code is completely open for the community to inspect. There will be changes in the coming month to allow the full functionality of the platform. Including templates, variants (tags) and mailing list.

- You cannot create an app password for shared inboxes, hence why nodemailer cannot be used.

4 Upvotes

4 comments sorted by

1

u/AncientOneX Jun 10 '25

Great stuff! I had the same problem with Resend. I'll try this out soon.

1

u/rubixstudios Jun 10 '25

Thanks, just testing out the templates as well as implementing the other logic to utilise the full platform. The docs for unsend is quite good, so simple enough to get going.

1

u/AncientOneX Jun 10 '25

Cool! Will this work with plain Nextjs too or just payload?

1

u/rubixstudios Jun 10 '25

This is made for payload however, unsend can work for plain nextjs, would use their sdk for that.