Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Commit

Permalink
Added SendGrid implementation for reference #443
Browse files Browse the repository at this point in the history
  • Loading branch information
monitobeko committed Dec 19, 2016
1 parent 925a9a6 commit 338e30e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Server/src/main/java/io/hawkcd/utilities/MailService.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,25 @@ public static void sendMail() {
} catch (MessagingException mex) {
mex.printStackTrace();
}

// Email from = new Email("[email protected]");
// String subject = "Hello from Hawk";
// Email to = new Email("[email protected]");
// Content content = new Content("text/plain", "HawkCD rocks and can now send emails!");
// Mail mail = new Mail(from, subject, to, content);
//
// SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
// Request request = new Request();
// try {
// request.method = Method.POST;
// request.endpoint = "mail/send";
// request.body = mail.build();
// Response response = sg.api(request);
// System.out.println(response.statusCode);
// System.out.println(response.body);
// System.out.println(response.headers);
// } catch (IOException ex) {
// throw ex;
// }
}
}

0 comments on commit 338e30e

Please sign in to comment.