Package com.cedarsolutions.shared.domain.email

Examples of com.cedarsolutions.shared.domain.email.EmailMessage


    /** Test createMessage() for a plaintext message. */
    @Test public void testCreateMessagePlaintext() throws Exception {
        String subject = "Subject";
        String plaintext = "Plaintext";

        EmailMessage email = new EmailMessage();
        email.setFormat(EmailFormat.PLAINTEXT);
        email.setSender(new EmailAddress("Example Sender", "sender@example.com"));
        email.setRecipients(new EmailAddress("Example Recipient", "recipient@example.com"));
        email.setReplyTo(new EmailAddress("Example Reply", "reply@example.com"));
        email.setSubject(subject);
        email.setPlaintext(plaintext);

        InternetAddress sender = new GaeEmailUtils().createInternetAddress("sender@example.com", "Example Sender");
        InternetAddress recipient = new GaeEmailUtils().createInternetAddress("recipient@example.com", "Example Recipient");
        InternetAddress replyTo = new GaeEmailUtils().createInternetAddress("reply@example.com", "Example Reply");
        List<InternetAddress> recipients = new ArrayList<InternetAddress>();
View Full Code Here


    @Test public void testCreateMessageMultipart() throws Exception {
        String subject = "Subject";
        String plaintext = "Plaintext";
        String html = "<p>Hello, world.</p>";

        EmailMessage email = new EmailMessage();
        email.setFormat(EmailFormat.MULTIPART);
        email.setSender(new EmailAddress("Example Sender", "sender@example.com"));
        email.setRecipients(new EmailAddress("Example Recipient", "recipient@example.com"));
        email.setReplyTo(new EmailAddress("Example Reply", "reply@example.com"));
        email.setSubject(subject);
        email.setPlaintext(plaintext);
        email.setHtml(html);

        InternetAddress sender = new GaeEmailUtils().createInternetAddress("sender@example.com", "Example Sender");
        InternetAddress recipient = new GaeEmailUtils().createInternetAddress("recipient@example.com", "Example Recipient");
        InternetAddress replyTo = new GaeEmailUtils().createInternetAddress("reply@example.com", "Example Reply");
        List<InternetAddress> recipients = new ArrayList<InternetAddress>();
View Full Code Here

     * Send an email message via the GAE container infrastructure.
     * @param template  Email message template to send
     */
    @Override
    public void sendEmail(EmailTemplate template) {
        EmailMessage email = generateEmail(template);
        this.sendEmail(email);
    }
View Full Code Here

            plaintext = this.templateService.renderTemplate(group, name, PLAINTEXT, context);
            html = this.templateService.renderTemplate(group, name, HTML, context);
            break;
        }

        EmailMessage email = new EmailMessage();
        email.setFormat(template.getFormat());
        email.setSender(template.getSender());
        email.setReplyTo(template.getReplyTo());
        email.setRecipients(template.getRecipients());
        email.setSubject(subject);
        email.setPlaintext(plaintext);
        email.setHtml(html);

        return email;
    }
View Full Code Here

        } catch (NotConfiguredException e) { }
    }

    /** Test sendEmail() for a message. */
    @Test public void testSendEmail() {
        EmailMessage email = new EmailMessage();

        GaeEmailService service = createService();
        Message message = mock(Message.class);
        when(service.getGaeEmailUtils().createMessage(email)).thenReturn(message);

View Full Code Here

TOP

Related Classes of com.cedarsolutions.shared.domain.email.EmailMessage

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.