PayloadCMS email integration

10 June, 2025

Integrations
Hero

Reliable and configurable email delivery is essential for applications that automate user communication and notification workflows. The @rubixstudios/payload-unsend adapter enables PayloadCMS to integrate directly with the Unsend email infrastructure, eliminating the need for external middleware. This integration supports both transactional and marketing email use cases through a secure and scalable configuration. This guide explains how to install the adapter, manage environment variables, and deploy it with hosted and self-managed Unsend instances.


PayloadCMS

PayloadCMS is an open-source, headless Content Management System engineered with Node.js and React. It adopts a code-first development paradigm, allowing content structures, access controls, and API behaviour to be defined directly in code. This model enhances maintainability, promotes version control, and aligns with modern software engineering practices.

Screenshot of the PayloadCMS admin panel showing a draft blog post titled "Breaking the Barrier: The Future of Launch Technology" with content and featured image displayed.

Features:

  • A fully customizable admin interface built in React
  • Support for both REST and GraphQL APIs
  • Native TypeScript integration for type safety and developer efficiency
  • Granular access control with built-in authentication strategies

PayloadCMS is purpose-built for teams requiring extensibility and control in content delivery systems. Its architecture supports both simple deployments and complex, high-traffic applications, making it suitable for marketing sites, SaaS platforms, internal tools, and enterprise-grade digital products.


Unsend

Unsend is an open-source email infrastructure platform designed to provide developers with full control over outbound email delivery through a REST API. It supports both transactional and marketing communications, offering a robust feature set for reliable and compliant email operations.

Screenshot of the Unsend email dashboard showing a list of sent emails with statuses such as Delivered, Opened, Clicked, and Complained, along with recipients and subjects.

Features:

  • Domain verification and management for authenticated sending
  • Engagement tracking, including email opens and link clicks
  • Subscription and unsubscribe management for list compliance
  • Seamless integration with Amazon Simple Email Service (SES) for high deliverability and scalability

Unsend is engineered for deployment flexibility. It can be operated as a hosted solution or deployed on-premise, making it suitable for teams that prioritize data ownership, regulatory compliance, and cost-efficiency in their email infrastructure.


Adapter

Rubix Studios’ @rubixstudios/payload-unsend serves as a direct integration layer between PayloadCMS and the Unsend email infrastructure. This adapter enables PayloadCMS to dispatch emails through Unsend’s REST API without relying on intermediary services or custom middleware.

This integration is well-suited for use cases requiring:

  • Seamless email integration within PayloadCMS for transactional and marketing workflows
  • Support for self-hosted deployments and regulatory requirements, including GDPR and HIPAA compliance
  • Transparent, auditable, and fully extensible architecture built on open-source standards

Features:

The adapter provides key capabilities that simplify integration and enhance operational efficiency:

  • Integration
    Enables PayloadCMS to communicate directly with Unsend’s REST API, allowing real-time email dispatch triggered by CMS events without middleware.
  • Flexibility
    Supports both hosted and self-managed Unsend deployments, offering compatibility with varied infrastructure and regulatory environments.
  • Security
    Utilizes environment variables for API credentials and endpoints, ensuring secure credential management and simplified deployment processes.

Installation

To integrate the adapter with PayloadCMS:

Installation

1pnpm add @rubixstudios/payload-unsend


Configuration

In your payload.config.js, import and set up the adapter:

1import { unsendAdapter } from '@rubixstudios/payload-unsend';
2
3export default buildConfig({
4 email: unsendAdapter({
5 defaultFromAddress: 'mail@rubixstudios.com.au',
6 defaultFromName: 'Rubix Studios',
7 apiKey: process.env.UNSEND_API_KEY || '',
8 unsendurl: process.env.UNSEND_URL || 'https://rubixstudios.com.au',
9 }),
10});


Variables

Ensure the following variables are defined in your environment:

1UNSEND_API_KEY=your-unsend-api-key
2UNSEND_URL=https://your-unsend-instance-url

Amazon SES

For self-hosted Unsend deployments using Amazon SES:

IAM user

  • Go to AWS Console → IAM → Users → Add users
  • Choose programmatic access

Permissions
Attach the following policies:

  • AmazonSESFullAccess
  • AmazonSNSFullAccess
Screenshot of the AWS IAM console showing the final step in creating a user named "unsend," with AmazonSESFullAccess and AmazonSNSFullAccess permissions assigned.

Credentials

  • Navigate to the IAM user's Security credentials
  • Create and note the Access key ID and Secret access key

Variables
In your Unsend deployment:

1AWS_ACCESS_KEY_ID=your-access-key-id
2AWS_SECRET_ACCESS_KEY=your-secret-access-key



Advantages

Compared to SaaS-based email services such as Resend, Unsend presents a strategic, developer-focused alternative with clear operational and financial benefits:

  • Efficiency
    By utilizing Amazon SES directly, Unsend enables substantial cost reductions relative to subscription-based SaaS platforms, particularly in high-volume scenarios.
  • Ownership
    Self-hosted deployments provide complete control over email content and user data, supporting rigorous compliance with standards such as GDPR and HIPAA.
  • Customization
    As an open-source solution, Unsend allows development teams to implement tailored features, integrations, and workflows aligned with specific organizational requirements.
  • Vendor
    Operating independently from third-party platforms mitigates vendor lock-in risks and ensures continuity despite service or pricing changes.

Contributions

The @rubixstudios/payload-unsend adapter is publicly available and actively maintained by Rubix Studios Pty. Ltd.

Developers are encouraged to participate in ongoing improvements by submitting enhancements, reporting bugs, or contributing to documentation.


The @rubixstudios/payload-unsend integration extends PayloadCMS with robust and configurable email capabilities, leveraging Unsend’s infrastructure for scalable and cost-efficient delivery. By adopting this solution, development teams gain enhanced control, improved compliance alignment, and the flexibility to tailor email operations to project-specific needs.

Organizations are invited to support ongoing development by contributing to the open-source repository, enabling broader adoption and continued innovation.