Example usage for com.amazonaws.services.simpleemail.model Destination withCcAddresses

List of usage examples for com.amazonaws.services.simpleemail.model Destination withCcAddresses

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleemail.model Destination withCcAddresses.

Prototype


public Destination withCcAddresses(java.util.Collection<String> ccAddresses) 

Source Link

Document

The recipients to place on the CC: line of the message.

Usage

From source file:org.springframework.cloud.aws.mail.simplemail.SimpleEmailServiceMailSender.java

License:Apache License

private SendEmailRequest prepareMessage(SimpleMailMessage simpleMailMessage) {
    Destination destination = new Destination();
    destination.withToAddresses(simpleMailMessage.getTo());

    if (simpleMailMessage.getCc() != null) {
        destination.withCcAddresses(simpleMailMessage.getCc());
    }// ww w  .  jav a2 s . c  o m

    if (simpleMailMessage.getBcc() != null) {
        destination.withBccAddresses(simpleMailMessage.getBcc());
    }

    Content subject = new Content(simpleMailMessage.getSubject());
    Body body = new Body(new Content(simpleMailMessage.getText()));

    SendEmailRequest emailRequest = new SendEmailRequest(simpleMailMessage.getFrom(), destination,
            new Message(subject, body));

    if (StringUtils.hasText(simpleMailMessage.getReplyTo())) {
        emailRequest.withReplyToAddresses(simpleMailMessage.getReplyTo());
    }

    return emailRequest;
}