sarbacane-sdk / php
Sarbacane SDK to send e-mail and text messages (sms).
1.0.6
2017-03-23 10:41 UTC
Requires
- php: >=5.3.0
- ext-curl: ^0.0.0
- phpmailer/phpmailer: ~5.2
This package is not auto-updated.
Last update: 2025-06-21 23:28:13 UTC
README
Sarbacane SDK PHP - Send e-mail and text messages (sms)
- Account & API Key
- Installation
- Download sources
- Authentication
- Buy credits
- Send E-mail
- Send SMS
- Webhooks
Account & API Key
Generate your E-mail Tokens (be logged in first)
SMS
Generate your SMS API Key (be logged in first)
Installation
composer require sarbacane-sdk/php
Sources
git clone https://github.com/sarbacane-sdk/php.git .
Authentication
sarbacane_sdk\authenticationManager::setEmailTokens('MY_EMAIL_USERNAME', 'MY_EMAIL_APIKEY');
SMS
sarbacane_sdk\authenticationManager::setSmsApikey('MY_SMS_APIKEY');
Credits
Send E-mail
$email = new sarbacane_sdk\SBEmailMessage();
$email->mailFrom = "sender@domain.com";
$email->mailFromName = "Sender Name";
$email->subject = "Message sent by Sarbacane SDK PHP";
$email->htmlBody = "Here is the <b>HTML</b> content of the message.";
$email->textBody = "Here is the TEXT content of the message.";
$email->recipients = array(
"address1@domain.com",
"address2@domain.com"
);
sarbacane_sdk\messagesManager::sendEmailMessage($email);
Send SMS
$sms = new \sarbacane_sdk\SBSmsMessage();
$sms->type = 'notification';
$sms->number = '+33600000000';
$sms->message = 'Code de confirmation: 283951';
$sms->sender = 'YourCompany';
$sms->campaignName = 'Code de confirmation';
$sms->category = 'codeConfirmation';
sarbacane_sdk\messagesManager::sendSmsMessage($sms);