CastBricks Docs

Java

Install and use the CastBrick Java SDK

Java SDK

Add dependency (Maven):

<dependency>
  <groupId>com.castbrick</groupId>
  <artifactId>castbrick</artifactId>
  <version>1.0.0</version>
</dependency>

Initialize:

import com.castbrick.CastBrick;

CastBrick client = new CastBrick(System.getenv("CASTBRICK_API_KEY"));

Send email:

EmailResponse resp = client.email().send(new EmailRequest()
  .from("no-reply@yourdomain.com")
  .to(Arrays.asList("alice@example.com"))
  .subject("Welcome")
  .html("<p>Hello Alice</p>")
);

Send SMS:

SmsResponse resp = client.sms().send(new SmsRequest()
  .from("+15551234567")
  .to(Arrays.asList("+15557654321"))
  .body("Your code is 123456")
);

On this page