Email API Reference
API reference for the Email module.
Send Email
Send Raw Email
POST /email/send
masterkey: {masterKey}
Request Body:
{
"to": "recipient@example.com",
"subject": "Hello",
"body": "<h1>Welcome!</h1>",
"from": "sender@example.com"
}
Send Template Email
POST /email/send
masterkey: {masterKey}
Request Body:
{
"to": "recipient@example.com",
"templateName": "welcome",
"variables": {
"userName": "John",
"activationLink": "https://..."
}
}
Templates
List Templates
GET /admin/email/templates
masterkey: {masterKey}
Get Template
GET /admin/email/templates/{templateId}
masterkey: {masterKey}
Create Template
POST /admin/email/templates
masterkey: {masterKey}
Request Body:
{
"name": "welcome",
"subject": "Welcome to {{appName}}",
"body": "<h1>Hello {{userName}}!</h1>",
"variables": ["appName", "userName"]
}
Update Template
PUT /admin/email/templates/{templateId}
masterkey: {masterKey}
Delete Template
DELETE /admin/email/templates/{templateId}
masterkey: {masterKey}
Provider Sync
Upload to Provider
POST /admin/email/templates/{templateId}/upload
masterkey: {masterKey}
Sync from Provider
POST /admin/email/sync
masterkey: {masterKey}
Configuration
Get Config
GET /admin/email/config
masterkey: {masterKey}
Update Config
PUT /admin/email/config
masterkey: {masterKey}
Request Body:
{
"provider": "mailgun",
"mailgun": {
"apiKey": "...",
"domain": "..."
}
}