- Account & API Key
- Installation
- Download sources
- Authentication
- Buy credits
- Send E-mail
- Send SMS
- Webhooks
Generate your E-mail Tokens (be logged in first)
Generate your SMS API Key (be logged in first)
composer require sarbacane-sdk/php
git clone https://github.com/sarbacane-sdk/php.git .
sarbacane_sdk\authenticationManager::setEmailTokens('MY_EMAIL_USERNAME', 'MY_EMAIL_APIKEY');
sarbacane_sdk\authenticationManager::setSmsApikey('MY_SMS_APIKEY');
$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);
$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);