use of com.mailjet.client.MailjetClient in project java-docs-samples by GoogleCloudPlatform.
the class MailjetSender method main.
public static void main(String[] args) throws MailjetException, MailjetSocketTimeoutException {
final String mailjetApiKey = "YOUR-MAILJET-API-KEY";
final String mailjetSecretKey = "YOUR-MAILJET-SECRET-KEY";
MailjetClient client = new MailjetClient(mailjetApiKey, mailjetSecretKey, new ClientOptions("v3.1"));
MailjetSender sender = new MailjetSender();
sender.sendMailjet(args[0], args[1], client);
}
use of com.mailjet.client.MailjetClient in project teammates by TEAMMATES.
the class MailjetService method sendEmailWithService.
@Override
protected void sendEmailWithService(EmailWrapper wrapper) throws MailjetException, MailjetSocketTimeoutException {
MailjetRequest email = parseToEmail(wrapper);
MailjetClient mailjet = new MailjetClient(Config.MAILJET_APIKEY, Config.MAILJET_SECRETKEY);
MailjetResponse response = mailjet.post(email);
if (isNotSuccessStatus(response.getStatus())) {
log.severe("Email failed to send: " + response.getData().toString());
}
}
Aggregations