Package com.amazonaws.services.simpleemail.model

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


        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

        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

    public void testSendInsightsAvailableEmail() throws Exception {
        ArgumentCaptor<SendEmailRequest> captor = ArgumentCaptor.forClass(SendEmailRequest.class);
        emailService.sendInsightsAvailableEmail(Arrays.asList(testUser));
        verify(mockAmazonSimpleEmailServiceClient).sendEmail(captor.capture());
        // WEEEEEEEEEEEEEEEEEEEEEEEEEEEE!
        Body body = captor.getValue().getMessage().getBody();
        Assert.assertFalse("Encountered unexpanded template token.", body.getHtml().getData().contains("${"));
        Assert.assertFalse("Encountered unexpanded template token.", body.getText().getData().contains("${"));
    }
View Full Code Here

    @Test
    public void testSendInviteUserActivationEmail() throws Exception {
        ArgumentCaptor<SendEmailRequest> captor = ArgumentCaptor.forClass(SendEmailRequest.class);
        emailService.sendInviteUserActivationEmail(testUser);
        verify(mockAmazonSimpleEmailServiceClient).sendEmail(captor.capture());
        Body body = captor.getValue().getMessage().getBody();
        Assert.assertFalse("Encountered unexpanded template token.", body.getHtml().getData().contains("${"));
        Assert.assertFalse("Encountered unexpanded template token.", body.getText().getData().contains("${"));
    }
View Full Code Here

    @Test
    public void testSendNewUserActivationEmail() throws Exception {
        ArgumentCaptor<SendEmailRequest> captor = ArgumentCaptor.forClass(SendEmailRequest.class);
        emailService.sendNewUserActivationEmail(testUser);
        verify(mockAmazonSimpleEmailServiceClient).sendEmail(captor.capture());
        Body body = captor.getValue().getMessage().getBody();
        Assert.assertFalse("Encountered unexpanded template token.", body.getHtml().getData().contains("${"));
        Assert.assertFalse("Encountered unexpanded template token.", body.getText().getData().contains("${"));
    }
View Full Code Here

    @Test
    public void testSendPasswordResetEmail() throws Exception {
        ArgumentCaptor<SendEmailRequest> captor = ArgumentCaptor.forClass(SendEmailRequest.class);
        emailService.sendPasswordResetEmail(testUser, true);
        verify(mockAmazonSimpleEmailServiceClient).sendEmail(captor.capture());
        Body body = captor.getValue().getMessage().getBody();
        Assert.assertFalse("Encountered unexpanded template token.", body.getHtml().getData().contains("${"));
        Assert.assertFalse("Encountered unexpanded template token.", body.getText().getData().contains("${"));
    }
View Full Code Here

    @Test
    public void testSendUserAccountSetupCompleteEmail() throws Exception {
        ArgumentCaptor<SendEmailRequest> captor = ArgumentCaptor.forClass(SendEmailRequest.class);
        emailService.sendUserAccountSetupCompleteEmail(testUser);
        verify(mockAmazonSimpleEmailServiceClient).sendEmail(captor.capture());
        Body body = captor.getValue().getMessage().getBody();
        Assert.assertFalse("Encountered unexpanded template token.", body.getHtml().getData().contains("${"));
        Assert.assertFalse("Encountered unexpanded template token.", body.getText().getData().contains("${"));
    }
View Full Code Here

    @Test
    public void testSendBugReport() throws Exception {
        ArgumentCaptor<SendEmailRequest> captor = ArgumentCaptor.forClass(SendEmailRequest.class);
        emailService.sendBugReport("username", "company", "summary", "details", "debuginfo");
        verify(mockAmazonSimpleEmailServiceClient).sendEmail(captor.capture());
        Body body = captor.getValue().getMessage().getBody();
        Assert.assertFalse("Encountered unexpanded template token.", body.getHtml().getData().contains("${"));
        Assert.assertFalse("Encountered unexpanded template token.", body.getText().getData().contains("${"));
    }
View Full Code Here

        testSenderUser.setId(new ObjectId());
        emailService.sendConnectionBrokenEmail(mockConnection);
        ArgumentCaptor<SendEmailRequest> captor = ArgumentCaptor.forClass(SendEmailRequest.class);
        verify(mockAmazonSimpleEmailServiceClient).sendEmail(captor.capture());
        Body body = captor.getValue().getMessage().getBody();
        String htmlContent = body.getHtml().getData();
        String textContent = body.getText().getData();
        Assert.assertFalse("Encountered unexpanded template token.", htmlContent.contains("${"));
        Assert.assertFalse("Encountered unexpanded template token.", textContent.contains("${"));
    }
View Full Code Here

TOP

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

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.