app/features/email/ses/SimpleEmailServiceImpl.java
/**
     * Sends an Email Message from the passed in fromEmail to the toEmails String[] with CCs
     * to the passed in ccEmails String[] and BCCs to the passed in bccEmails String[].
     *
     * @param from      Sender email address as a String
     * @param toEmails  Recipient email addresses as a String[]
     * @param ccEmails  CC recipient email addresses as a String[]
     * @param bccEmails BCC recipient email addresses as a String[]
     * @param subject   Email subject as a String
     * @param body      Email message body as a String
     * @param asHtml    Message body as HTML or Plain Text
     * @throws EmailMessagingException
     */
Sends an Email Message from the passed in fromEmail to the toEmails String[] with CCs
to the passed in ccEmails String[] and BCCs to the passed in bccEmails String[].


Sends an Email Message from the passed in fromEmail to the toEmails String [] with CCs to the passed in ccEmails String [] and BCCs to the passed in bccEmails String [] .
public void sendEmail(String from, String[] toEmails, String[] ccEmails, String[] bccEmails,
                          String subject, String body, boolean asHtml)
            throws EmailMessagingException {
        if (!new EmailValidator().validate(from)) {
            throw new EmailMessagingException("The provided from address ("
                    + from + ") is not a valid email.");
        }
        if (toEmails == null || subject == null || body == null) {
            throw new EmailMessagingException(
                    new IllegalArgumentException(" You must provide a valid, non-null fromEmail, toEmail, subject and body."));
        }
        Destination destination = new Destination().withToAddresses(toEmails);
        if (ccEmails != null) {
            destination.withCcAddresses(ccEmails);
        }
        if (bccEmails != null) {
            destination.withBccAddresses(bccEmails);
        }
        Content subjectContent = new Content().withData(subject);
        Content messageContent = new Content().withData(body);
        Body bodyContent = new Body();
        if (asHtml) {
            bodyContent.withHtml(messageContent);
        } else {
            bodyContent.withText(messageContent);
        }
        Message message = new Message()
                .withSubject(subjectContent)
                .withBody(bodyContent);
        SendEmailRequest request = new SendEmailRequest()
                .withSource(from)
                .withDestination(destination)
                .withMessage(message);
        try {
            sesClient.sendEmail(request);
        } catch (Exception e) {
            LOGGER.error("Could not send email via AWS Simple Email Service.", e);
            throw new EmailMessagingException("Could not send email via AWS Simple Email Service.", e);
        }
    }
public void sendEmail ( String from , String [ ] toEmails , String [ ] ccEmails , String [ ] bccEmails , String subject , String body , boolean asHtml ) throws EmailMessagingException { if ( ! new EmailValidator ( ) . validate ( from ) ) { throw new EmailMessagingException ( "The provided from address (" + from + ") is not a valid email." ) ; } if ( toEmails == null || subject == null || body == null ) { throw new EmailMessagingException ( new IllegalArgumentException ( " You must provide a valid, non-null fromEmail, toEmail, subject and body." ) ) ; } Destination destination = new Destination ( ) . withToAddresses ( toEmails ) ; if ( ccEmails != null ) { destination . withCcAddresses ( ccEmails ) ; } if ( bccEmails != null ) { destination . withBccAddresses ( bccEmails ) ; } Content subjectContent = new Content ( ) . withData ( subject ) ; Content messageContent = new Content ( ) . withData ( body ) ; Body bodyContent = new Body ( ) ; if ( asHtml ) { bodyContent . withHtml ( messageContent ) ; } else { bodyContent . withText ( messageContent ) ; } Message message = new Message ( ) . withSubject ( subjectContent ) . withBody ( bodyContent ) ; SendEmailRequest request = new SendEmailRequest ( ) . withSource ( from ) . withDestination ( destination ) . withMessage ( message ) ; try { sesClient . sendEmail ( request ) ; } catch ( Exception e ) { LOGGER . error ( "Could not send email via AWS Simple Email Service." , e ) ; throw new EmailMessagingException ( "Could not send email via AWS Simple Email Service." , e ) ; } }
Sends an Email Message from the passed in fromEmail to the toEmails String[] with CCs
 to the passed in ccEmails String[] and BCCs to the passed in bccEmails String[].
Sends an Email Message from the passed in fromEmail to the toEmails String [] with CCs to the passed in ccEmails String [] and BCCs to the passed in bccEmails String [] .
// Create message subject and body content as HTML // Create Message with Content parts // Assemble the email // Send Email via the AmazonSimpleEmailServiceClient