Skip to content

sarbacane-sdk/java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

alt tag

Sarbacane SDK JAVA - Send e-mail and text messages (sms)

  • Account & API Key
  • Load artefact from pom.xml
  • Download JAR
  • 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

pom.xml

<dependency>
  <groupId>com.sarbacane</groupId>
  <artifactId>sarbacane-sdk</artifactId>
  <version>1.0.7</version>
</dependency>

JAR

Download

Sources

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

Authentication

E-mail
AuthenticationManager.setEmailTokens('MY_EMAIL_USERNAME', 'MY_EMAIL_APIKEY');
SMS
AuthenticationManager.setSmsApikey('MY_SMS_APIKEY');

Credits

Buy E-mail credits

Buy SMS credits

Send E-mail

    SBEmailMessage email = new SBEmailMessage();
    email.setMailFrom("sender@domain.com");
    email.setMailFromName("Sender Name");
    email.setSubject("Message sent by Sarbacane SDK JAVA");
    email.setHtmlBody("Here is the <b>HTML</b> content of the message.");
    email.setTextBody("Here is the content of the message");
    email.setRecipients(
            Arrays.asList(
                "address1@domain.com",
                "address2@domain.com"
            )
    );
    MessagesManager.sendEmailMessage(email);

Send SMS

    SBSmsMessage msg = new SBSmsMessage();
    msg.setType("notification");
    msg.setNumber("+33600000000");
    msg.setMessage("Confirmation code is: 283951");
    msg.setSender("SBSMS");
    msg.setCategory("confirmationCode");
    msg.setCampaignName("Authentication confirmation code");
    MessagesManager.sendSmsMessage(msg);

About

Sarbacane SDK Java to send E-mails & Text messages (sms).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages