Send Email
Send single or bulk email notifications with support for HTML content, attachments, templates, CC/BCC recipients, and delivery tracking through multiple email providers.
Headers
- Authorization:
Bearer YOUR_API_KEY
- Content-Type:
application/json
Body Parameters
to_email
Required - Email address of the recipient. For bulk emails, provide an array of email addresses.
subject
Required - Email subject line.
message
Required - Email content. Supports HTML and plain text.
from_email
Optional - Sender email address (default: [email protected]).
reply_to
Optional - Reply-to email address.
cc_emails
Optional - Array of CC email addresses.
bcc_emails
Optional - Array of BCC email addresses.
template_id
Optional - ID of email template to use.
template_data
Optional - Object containing template variable values.
attachments
Optional - Array of attachment objects with name, content (base64), and content_type.
Sample Requests
Send Single Email
curl -X POST https://api.ping.co.zw/v1/notification/api/email/send \ -H "Authorization: Bearer sk_test_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "to_email": "[email protected]", "subject": "Welcome to Ping!", "message": "<h1>Welcome!</h1><p>Thank you for joining us. Your account is now active.</p>", "from_email": "[email protected]", "reply_to": "[email protected]" }'
Response Format
Success Response
{ "result": "success", "message": "Email sent successfully", "environment": "test", "details": { "status": "success", "message_id": "abc123-def456" } }
Bulk Email Response
{ "result": "success", "message": "Sending email to 3 recipients in background", "environment": "test", "bulkId": "bulk_uuid_here" }
Error Response
{ "result": "error", "error": { "type": "BadRequest", "message": "Invalid email address format" } }
Supported Content Types
- HTML - Rich HTML content with styling
- Plain Text - Simple text content
- Mixed - HTML with plain text fallback
Attachment Guidelines
- Maximum attachment size: 10MB per file
- Maximum total attachments per email: 25MB
- Supported formats: PDF, DOC, DOCX, XLS, XLSX, PNG, JPG, GIF
- Content must be base64 encoded
Email Limits
- Subject line: 255 characters maximum
- Bulk email: Up to 1000 recipients per request
- CC/BCC: Up to 50 recipients each
- Rate limit: 100 emails per minute per API key