- Account & API Key
- Load artefact from pom.xml
- Download JAR
- 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)
<dependency>
<groupId>com.sarbacane</groupId>
<artifactId>sarbacane-sdk</artifactId>
<version>1.0.7</version>
</dependency>
git clone https://github.com/sarbacane-sdk/java.git .
AuthenticationManager.setEmailTokens('MY_EMAIL_USERNAME', 'MY_EMAIL_APIKEY');
AuthenticationManager.setSmsApikey('MY_SMS_APIKEY');
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);
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);