PAY HERO DOCS
  • Introduction-Pay Hero Developer APIs
  • Creating Account
  • Authorization
  • GET: Service Wallet Balance
  • GET: Payments Wallet Balance
  • POST: Service Wallet Top Up
  • POST: Initiate MPESA STK Push Request
  • Payment Button
  • Lipwa Link
  • POST: Pay Hero Wallet- Withdraw To Mobile
  • GET: Account Transactions
  • GET: Transaction Status
  • WooCommerce Plugin
    • Plugin Installation
  • Shopify
  • Videos
  • Other Integrations
  • Email API Reference
    • Register SMTP
    • Send Email
    • Mail status
  • WhatsApp API Reference
    • Introduction
    • Getting Started
    • Send API Whats App Text
    • Bulk WhatsApp API Messaging
    • Bulk WhatsApp Using UI/CSV File
Powered by GitBook
On this page

Was this helpful?

  1. Email API Reference

Send Email

Send bulk emails

PreviousRegister SMTPNextMail status

Was this helpful?

Send Email

post

Send Email

This endpoint allows you to send an email using the specified payload.

Request Body

  • sender_email (string): The email address of the sender.

  • sender_name (string): The name of the sender.

  • api_username (string): Your Pay Hero API API username for authentication.

  • reply_to (string): The email address to which replies should be sent.

  • recipients (array): An array of recipient objects containing the following fields:

    • email (string): The email address of the recipient.

    • name (string): The name of the recipient.

    • subject (string): The subject of the email.

    • body (string): The body of the email.

Response Body

The response is in the form of a JSON schema with the following structure:

{
  "success": [
    {
      "id": "",
      "recipient_email": ""
    }
  ],
  "errors": []
}

The success array contains objects with id and recipient_email fields for successful email deliveries. The errors array is empty when there are no errors in the request.

Body
objectOptionalExample: {"sender_email":"sender@gmail.com","sender_name":"Sender","api_username":"D1xqubAG1br0pGZTEST","reply_to":"sender@gmail.com","recipients":[{"email":"johndoe@mailinator.com","name":"John Doe","subject":"Welcome to Hala Kanairo, John!","body":"Dear John Doe,\n\nWelcome to Hala Kanairo! We’re excited to have you join our community. Get ready for a world of opportunities, resources, and connections tailored just for you.\n\nLet’s embark on this journey together!\n\nBest regards,\nThe Hala Kanairo Team"},{"email":"janedoe@mailinator.com","name":"Jane Doe","subject":"Your Recent Purchase – Thank You, Jane!","body":"Hi Jane Doe,\n\nThank you for your recent purchase from Hala Kanairo! We hope your new items bring you joy and inspiration. If you need anything, we’re just a message away.\n\nHappy exploring!\n\nBest,\nThe Hala Kanairo Team"},{"email":"supportuser@mailinator.com","name":"Support User","subject":"Update on Your Support Ticket","body":"Hello Support User,\n\nYour support ticket has been updated! Please log in to your account to view the latest details. We’re here to help, so don’t hesitate to reach out if you need further assistance.\n\nRegards,\nThe Hala Kanairo Support Team"}]}
Responses
200
OK
application/json
Responseobject
403
Forbidden
application/json
post
POST /mailer/send HTTP/1.1
Host: applet.payherokenya.com
Content-Type: application/json
Accept: */*
Content-Length: 1214

{
  "sender_email": "sender@gmail.com",
  "sender_name": "Sender",
  "api_username": "D1xqubAG1br0pGZTEST",
  "reply_to": "sender@gmail.com",
  "recipients": [
    {
      "email": "johndoe@mailinator.com",
      "name": "John Doe",
      "subject": "Welcome to Hala Kanairo, John!",
      "body": "Dear John Doe,\n\nWelcome to Hala Kanairo! We’re excited to have you join our community. Get ready for a world of opportunities, resources, and connections tailored just for you.\n\nLet’s embark on this journey together!\n\nBest regards,\nThe Hala Kanairo Team"
    },
    {
      "email": "janedoe@mailinator.com",
      "name": "Jane Doe",
      "subject": "Your Recent Purchase – Thank You, Jane!",
      "body": "Hi Jane Doe,\n\nThank you for your recent purchase from Hala Kanairo! We hope your new items bring you joy and inspiration. If you need anything, we’re just a message away.\n\nHappy exploring!\n\nBest,\nThe Hala Kanairo Team"
    },
    {
      "email": "supportuser@mailinator.com",
      "name": "Support User",
      "subject": "Update on Your Support Ticket",
      "body": "Hello Support User,\n\nYour support ticket has been updated! Please log in to your account to view the latest details. We’re here to help, so don’t hesitate to reach out if you need further assistance.\n\nRegards,\nThe Hala Kanairo Support Team"
    }
  ]
}
{
  "success": [
    {
      "id": "3",
      "recipient_email": "codegeekskenya@gmail.com"
    },
    {
      "id": "4",
      "recipient_email": "ronaldimbwori@gmail.com"
    }
  ],
  "errors": []
}