Skip to content

Sarbacane SDK PHP to send E-mails and Text messages (sms).

License

Notifications You must be signed in to change notification settings

sarbacane-sdk/php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt tag

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

E-mail

Create E-mail account

Generate your E-mail Tokens (be logged in first)

email tokens

SMS

Create SMS account

Generate your SMS API Key (be logged in first)

api_key_real

Installation

composer require sarbacane-sdk/php

Sources

git clone https://github.com/sarbacane-sdk/php.git .

Authentication

E-mail
sarbacane_sdk\authenticationManager::setEmailTokens('MY_EMAIL_USERNAME', 'MY_EMAIL_APIKEY');
SMS
sarbacane_sdk\authenticationManager::setSmsApikey('MY_SMS_APIKEY');

Credits

Buy E-mail credits

Buy SMS 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);

About

Sarbacane SDK PHP to send E-mails and Text messages (sms).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages