Use this api to send emails between your associated accounts.

URL - https://app.bongasms.co.ke/api/send-bulk-email

METHOD - POST

Response - JSON

Request Parameters

NameDescriptionTypeOption
apiClientIDAPI Client ID (Provided above)NumericMandatory
keyAPI Key (Provided above)StringMandatory
secretClient ID you are transferring toStringMandatory
subjectEmail subjectStringMandatory
fromSender emailStringMandatory
torecepient emailStringMandatory
bodyEmail bodyStringOptional
sender namename of senderStringOptional
recipient namename of recepientStringOptional
attributesplaceholders for the template htmljsonOptional
ccemails separated by a commaStringOptional
bccemails separated by a commaStringOptional
scheduletime in yyyy-mm-ddStringOptional

Response Parameters

NameDescTypeOption
statusStatus of the request (222 - success, 666 - error)NumericMandatory
status_messageDescription of statusStringMandatory
batch_codeCode representing the batch of sent messagesStringOptional
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://app.bongasms.co.ke/api/send-bulk-email');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/x-www-form-urlencoded'
));
$request->addPostParameter(array(
  'key' => 'OnwyU5jV6dIdss25',
  'secret' => 'n0WqOyhKsx2H3trertwercU5ag4A2zJsPej',
  'apiClientID' => '-12',
  'subject' => 'HELP ME GROW MY BUSINESS',
  'from' => 'helpmegrow@.helpmegrow.com',
  'to' => 'ria.helpmegrow@ohelpmegrow.co',
  'body' => '<!DOCTYPE html>\n<html>\n<head>\n <title>HTML Email Example</title>\n</head>\n<body>\n    <h1>Hello!</h1>\n </p><p>[%EMAIL%]  wants you to help them grow their business</body>\n</html>
',
  'sender_name' => 'helpmegrow website',
  'recipient_name' => 'INFO',
  'attachments' => '',
  'attributes' => '{"EMAIL":" jones@gmail.com",}',
  'cc' => 'helpmegrow@gmail.com, khelpmegrowi@gmail.com',
  'bcc' => 'kehelpmegrowi@gmail.com, rhelpmegrow7@gmail.com',
  'schedule' => '2023-09-10-13:00:00'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

 

 
{
    "unique_id":378008604,
    "status_message":"sent",
    "status":222,
    "batch_code":"lorem ipsum"
}