Custom Email Provider
Connect Aampe to your own email infrastructure when you need full control over delivery or when using an email provider not yet supported by Aampe’s native integrations.Requirements
Aampe will need the following in order to deliver messages on your behalf:- A publicly accessible HTTP endpoint that accepts POST requests
- An authentication method (API key, Bearer token, or custom header)
- The ability to process JSON payloads and return JSON responses
API Contract
Your endpoint should implement the following contract for Aampe to successfully deliver email messages.Request Format
Aampe sends aPOST request with the following headers:
Payload Structure (Minimal)
Field Reference
| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient email address |
from | string | Yes | Sender name and email address |
content.subject | string | Yes | Email subject line |
content.body | string | Yes | Email body in HTML format |
metadata | object | No | Additional data for tracking or debugging |
metadata.message_id | string | No | Unique identifier for the message |
Note: The body field contains HTML content. Plain text fallback support is optional on your end.
Response Format
Your endpoint should return JSON responses with appropriate HTTP status codes. Success (200 OK):Example Implementation
Here’s a sample cURL request showing a common payload format:Troubleshooting
Connection test fails- Verify your endpoint is publicly accessible (not behind a firewall or VPN)
- Check that your authentication credentials are correct
- Ensure your endpoint returns valid JSON responses
- Confirm your endpoint returns a
200 OKstatus for successful requests - Check your endpoint logs for incoming requests from Aampe
- Verify the
provider_message_idis being returned in successful responses