eavan5

payload email ahasend

by eavan5
Email
v3
^3.0.0

Overview

Summary generated from the README

An email adapter for Payload CMS 3 that sends transactional email through the AhaSend service. It is set as the email option in the Payload config with an API key and default sender details. API v2 requires an account ID, and the package ships TypeScript types.

Features

  • Supports AhaSend API v1 and v2
  • Sends HTML and plain text emails
  • File attachments as Buffer, string or data URI
  • Custom headers and reply-to addresses
  • Multiple and named recipients
  • Error details including failed recipients and success counts

Use cases

  • Send Payload transactional emails such as password resets through AhaSend
  • Replace the default email adapter in a Payload 3 project with an AhaSend account

From the author

Payload Ahasend Email Adapter

Installation

npm i payload-email-ahasend

1

Stars

0

Forks

1

Open Issues

1 weeks ago

Last Updated

0

Weekly Downloads

v2.0.0

npm Version

107.0 KB

Unpacked Size

0

Dependencies

GitHub stars

Trends appear after 7 days of data. Daily snapshots have not started yet.

npm weekly downloads

Trends appear after 7 days of data. Daily snapshots have not started yet.

Each point is npm's rolling 7-day download count.

Health Score

37/100Fair

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/944525693-root.svg)](https://payloaddirectory.dev/plugins/944525693-root)
HTML
<a href="https://payloaddirectory.dev/plugins/944525693-root"><img src="https://payloaddirectory.dev/badge/944525693-root.svg" alt="Payload Directory"></a>
Updated Oct 13, 2026Created Mar 7, 2025Published Mar 9, 2026

README

Payload CMS Ahasend Email Adapter

A custom email adapter for Payload CMS that integrates with the Ahasend email service API.

Features

  • Easy integration with Payload CMS
  • Support for AhaSend API v1 and v2
  • HTML and plain text emails
  • File attachments support
  • Custom headers
  • Reply-to functionality
  • Comprehensive error handling
  • TypeScript support
  • Compatible with Next.js 14+/15+/16+ and Payload CMS 3+

Requirements

  • Node.js 20.9.0+
  • Payload CMS 3.0.0+
  • Next.js 14.0.0+ (if using with Next.js)
  • React 18.2.0+ or 19.0.0+

Installation

npm install payload-email-ahasend
# or
yarn add payload-email-ahasend
# or
pnpm add payload-email-ahasend

Usage

API v1 (Default)

import { ahasendAdapter } from "payload-email-ahasend";
import { buildConfig } from "payload";

export default buildConfig({
  // ... other config options
  email: ahasendAdapter({
    apiKey: "your-ahasend-api-key",
    defaultFromAddress: "[email protected]",
    defaultFromName: "Your Company Name",
  }),
});

API v2

import { ahasendAdapter } from "payload-email-ahasend";
import { buildConfig } from "payload";

export default buildConfig({
  // ... other config options
  email: ahasendAdapter({
    apiKey: "your-ahasend-v2-api-key",
    defaultFromAddress: "[email protected]",
    defaultFromName: "Your Company Name",
    apiVersion: "v2",
    accountId: "your-account-id",
  }),
});

Environment Variables

AHASEND_API_KEY=your-api-key-here
AHASEND_ACCOUNT_ID=your-account-id-for-v2

Configuration Options

OptionTypeRequiredDescription
apiKeystring✅Your Ahasend API key
defaultFromAddressstring✅Default sender email address
defaultFromNamestring✅Default sender name
apiVersion'v1' | 'v2'❌API version to use (default: 'v1')
accountIdstringv2 onlyAccount ID for API v2

Email Features

The adapter supports:

  • HTML and plain text email content
  • File attachments (Buffer, string, and data URI)
  • Custom headers
  • Reply-to addresses
  • Multiple recipients
  • Named recipients (e.g., "John Doe <[email protected]>")

Error Handling

The adapter provides detailed error information including:

  • API response status
  • Failed recipients
  • Success/failure counts
  • Detailed error messages

TypeScript Support

The package includes full TypeScript definitions and interfaces for type safety.

Version Compatibility

VersionPayload CMSNext.jsReactNode.jsAhaSend API
2.0.0+3.0.0+14/15/1618.2+ / 19+20.9.0+v1 & v2
1.0.53.0.0+14/1518.2+ / 19+18.20.2+v1 only
1.0.43.25.0Any18.2+18.20.2+v1 only

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Tags

Similar plugins