Keplers Mail Service

Send Emails

Start sending emails with priority queue processing and advanced features

Send emails through Keplers Mail Service using two simple endpoints for different use cases.

Two Email Types:

  • Instant: For critical emails like 2FA codes (0-5 seconds delivery)
  • Queue: For regular emails (queue-based processing)

Quick Start

Send Regular Email

curl -X POST https://api.keplars.com/api/v1/send-email/queue \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["[email protected]"],
    "subject": "Welcome!",
    "body": "Thank you for signing up!"
  }'

Send Instant Email

For critical emails like 2FA codes:

curl -X POST https://api.keplars.com/api/v1/send-email/instant \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["[email protected]"],
    "subject": "Your verification code",
    "body": "Your code: 123456"
  }'

Email Types

Basic Email

{
  "to": ["[email protected]"],
  "subject": "Email subject",
  "body": "Email content"
}

HTML Email

{
  "to": ["[email protected]"],
  "subject": "Welcome!",
  "body": "<h1>Welcome!</h1><p>Thank you for joining.</p>",
  "is_html": true
}

Template Email

{
  "to": ["[email protected]"],
  "template_id": "019a1d8f-d961-7ca3-a775-5e7f4e0c6a60",
  "params": {
    "user_name": "John",
    "verification_code": "123456"
  }
}

JavaScript Example

async function sendEmail(emailData) {
  const response = await fetch('https://api.keplars.com/api/v1/send-email/queue', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.KEPLERS_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(emailData)
  });
  
  return response.json();
}

// Send welcome email
await sendEmail({
  to: ['[email protected]'],
  subject: 'Welcome!',
  body: 'Welcome to our platform!'
});

Check Email Status

curl -X GET https://api.keplars.com/api/v1/emails/{emailId}/status \
  -H "Authorization: Bearer YOUR_API_KEY"

Response:

{
  "success": true,
  "data": {
    "id": "email_id",
    "status": "delivered",
    "created_at": "2024-01-15T10:30:00Z",
    "delivered_at": "2024-01-15T10:30:45Z"
  }
}

Response Format

Success

{
  "success": true,
  "data": {
    "id": "email_id",
    "message": "Email sent successfully"
  }
}

Error

{
  "success": false,
  "error": "Invalid email address",
  "code": "INVALID_EMAIL"
}

Next Steps

  • Webhooks - Get delivery notifications
  • Examples - See integration examples for your programming language
  • AI Templates - Generate email templates

Start sending emails with Keplers Mail Service. Choose instant for critical emails or queue for regular communications.

On this page