This repository has been archived by the owner on Jun 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SendGrid implementation for reference #443
- Loading branch information
monitobeko
committed
Dec 19, 2016
1 parent
925a9a6
commit 338e30e
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
// } | ||
} | ||
} |