Skip to content

Instantly share code, notes, and snippets.

@robertacosta
robertacosta / asm.java
Last active August 29, 2015 14:19
Developer Example of sending an email with SendGrid ASM
private void sendPatientAssignment(Principle user, String patientName, String patientRoom) {
Logger logger = LoggerFactory.getLogger(AdminController.class);
SendGrid sendgrid = new SendGrid(System.getenv("SENDGRID_API_KEY"));
SendGrid.Email email = new SendGrid.Email();
email.addTo(user.getEmail());
email.setFrom(System.getenv("SENDGRID_FROM_EMAIL"));
email.setSubject("Attemper EMR. You have a new patient assignment.");
email.setHtml(user.getFirstName());
email.setASMGroupId(124);