Package com.amazonaws.services.simpleemail.model

Examples of com.amazonaws.services.simpleemail.model.Content


        return request;
    }

    private com.amazonaws.services.simpleemail.model.Message createMessage(Exchange exchange) {
        com.amazonaws.services.simpleemail.model.Message message = new com.amazonaws.services.simpleemail.model.Message();
        message.setBody(new Body(new Content(exchange.getIn().getBody(String.class))));
        message.setSubject(new Content(determineSubject(exchange)));
        return message;
    }
View Full Code Here


    private com.amazonaws.services.simpleemail.model.Message createMessage(Exchange exchange) {
        com.amazonaws.services.simpleemail.model.Message message = new com.amazonaws.services.simpleemail.model.Message();
        Boolean isHtmlEmail = exchange.getIn().getHeader(SesConstants.HTML_EMAIL, false, Boolean.class);
        String content = exchange.getIn().getBody(String.class);
        if (isHtmlEmail) {
            message.setBody(new Body().withHtml(new Content().withData(content)));
        } else {
            message.setBody(new Body().withText(new Content().withData(content)));
        }
        message.setSubject(new Content(determineSubject(exchange)));
        return message;
    }
View Full Code Here

        toAddresses.add(to);

        Destination dest = new Destination().withToAddresses(toAddresses);
        request.setDestination(dest);

        Content subjContent = new Content().withData(subject);
        Message msg = new Message().withSubject(subjContent);

        // Include a body in both text and HTML formats
        Body theBody = new Body();
        if (textBody != null) {
            theBody.withText(new Content().withData(textBody));
        }
        if (htmlBody != null) {
            theBody.withHtml(new Content().withData(htmlBody));
        }
        msg.setBody(theBody);

        request.setMessage(msg);
View Full Code Here

        // Construct an object to contain the recipient address.
        Destination destination = new Destination().withToAddresses(new String[]{TO});

        // Create the subject and body of the message.
        Content subject = new Content().withData(SUBJECT);
        Content textBody = new Content().withData(BODY);
        Body body = new Body().withText(textBody);

        // Create a message with the specified subject and body.
        Message message = new Message().withSubject(subject).withBody(body);
View Full Code Here

            LOGGER.error(msg);
            throw new RuntimeException(msg);
        }
        Destination destination = new Destination().withToAddresses(to)
                .withCcAddresses(getCcAddresses(to));
        Content subjectContent = new Content(subject);
        Content bodyContent = new Content();
        Body msgBody = new Body(bodyContent);
        msgBody.setHtml(new Content(body));
        Message msg = new Message(subjectContent, msgBody);
        String sourceAddress = getSourceAddress(to);
        SendEmailRequest request = new SendEmailRequest(sourceAddress, destination, msg);
        request.setReturnPath(sourceAddress);
        LOGGER.debug(String.format("Sending email with subject '%s' to %s",
View Full Code Here

    if (emails != null && !emails.isEmpty() && !StringUtils.isBlank(body)) {
      final SendEmailRequest request = new SendEmailRequest().withSource(Config.SUPPORT_EMAIL);
      Destination dest = new Destination().withToAddresses(emails);
      request.setDestination(dest);

      Content subjContent = new Content().withData(subject);
      Message msg = new Message().withSubject(subjContent);

      // Include a body in both text and HTML formats
      Content textContent = new Content().withData(body);
      msg.setBody(new Body().withText(textContent));

      request.setMessage(msg);

      Utils.asyncExecute(new Runnable() {
View Full Code Here

    // API

    public final SendEmailResult sendOneMail(final String sender, final String recipient, final String subject, final String body) {
        final Destination destination = new Destination(Lists.newArrayList(recipient));

        final Content subjectContent = new Content(subject);
        final Content bodyContent = new Content(body);
        final Body msgBody = new Body(bodyContent);
        final Message msg = new Message(subjectContent, msgBody);

        final SendEmailRequest request = new SendEmailRequest(sender, destination, msg);
View Full Code Here

    if (emails != null && !emails.isEmpty() && !StringUtils.isBlank(body)) {
      final SendEmailRequest request = new SendEmailRequest().withSource(Config.SUPPORT_EMAIL);
      Destination dest = new Destination().withToAddresses(emails);
      request.setDestination(dest);

      Content subjContent = new Content().withData(subject);
      Message msg = new Message().withSubject(subjContent);

      // Include a body in both text and HTML formats
      Content textContent = new Content().withData(body);
      msg.setBody(new Body().withText(textContent));

      request.setMessage(msg);

      Utils.asyncExecute(new Callable<Object>() {
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpleemail.model.Content

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.