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
Name | Description | Type | Option |
---|---|---|---|
apiClientID | API Client ID (Provided above) | Numeric | Mandatory |
key | API Key (Provided above) | String | Mandatory |
secret | Client ID you are transferring to | String | Mandatory |
subject | Email subject | String | Mandatory |
from | Sender email | String | Mandatory |
to | recepient email | String | Mandatory |
body | Email body | String | Optional |
sender name | name of sender | String | Optional |
recipient name | name of recepient | String | Optional |
attributes | placeholders for the template html | json | Optional |
cc | emails separated by a comma | String | Optional |
bcc | emails separated by a comma | String | Optional |
schedule | time in yyyy-mm-dd | String | Optional |
Response Parameters
Name | Desc | Type | Option |
---|---|---|---|
status | Status of the request (222 - success, 666 - error) | Numeric | Mandatory |
status_message | Description of status | String | Mandatory |
batch_code | Code representing the batch of sent messages | String | Optional |
<?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"
}