Package com.alibaba.citrus.service.mail.builder.content

Examples of com.alibaba.citrus.service.mail.builder.content.HTMLTemplateContent


        assert_TextPlain_mytemplate_noPullTools("freemarker");
    }

    @Test
    public void simpleHtml_vm_pull() throws Exception {
        initContent(new HTMLTemplateContent("mail/mytemplate.vm"), true, true);
        builder.setAttribute("hello", "world");
        assert_TextHtml_mytemplate_pullTools_and_vars("velocity");
    }
View Full Code Here


        assert_TextHtml_mytemplate_pullTools_and_vars("velocity");
    }

    @Test
    public void simpleHtml_ftl_pull() throws Exception {
        initContent(new HTMLTemplateContent("mail/mytemplate.ftl"), true, true);
        builder.setAttribute("hello", "world");
        assert_TextHtml_mytemplate_pullTools_and_vars("freemarker");
    }
View Full Code Here

        assert_TextHtml_mytemplate_pullTools_and_vars("freemarker");
    }

    @Test
    public void complexHtml_noResourceLoader() throws Exception {
        initContent(new HTMLTemplateContent("mail/complexhtml.vm"), true, true);
        content.addInlineResource("image", "/");

        try {
            getMessageAsText();
            fail();
View Full Code Here

        }
    }

    @Test
    public void complexHtml_vm() throws Exception {
        initContent(new HTMLTemplateContent("mail/complexhtml.vm"), true, true);
        content.setResourceLoader(factory);
        content.addInlineResource("image", "/");

        assert_TextHtml_complex("velocity");
    }
View Full Code Here

        assert_TextHtml_complex("velocity");
    }

    @Test
    public void complexHtml_ftl() throws Exception {
        initContent(new HTMLTemplateContent("mail/complexhtml.ftl"), true, true);
        content.setResourceLoader(factory);
        content.addInlineResource("image", "/");

        assert_TextHtml_complex("freemarker");
    }
View Full Code Here

        assert_TextHtml_complex("freemarker");
    }

    @Test
    public void complexHtml_imageNotFound() throws Exception {
        initContent(new HTMLTemplateContent("mail/imageNotFound.vm"), true, true);
        content.setResourceLoader(factory);
        content.addInlineResource("image", "/");

        try {
            getMessageAsText();
View Full Code Here

        }
    }

    @Test
    public void complexHtml_streamOnlyResource() throws Exception {
        initContent(new HTMLTemplateContent("mail/streamOnlyResource.vm"), true, true);
        content.setResourceLoader(factory);
        content.addInlineResource("image", "/asStream");

        assert_TextHtml_streamOnlyResource();
    }
View Full Code Here

        assert_TextHtml_streamOnlyResource();
    }

    @Test
    public void complexHtml_dup_fileNames() throws Exception {
        initContent(new HTMLTemplateContent("mail/dup_fileNames.vm"), true, true);
        content.setResourceLoader(factory);
        content.addInlineResource("image1", "/");
        content.addInlineResource("image2", "/mailres");

        String eml = getMessageAsText();
View Full Code Here

        assertEquals(3, StringUtil.countMatches(eml, "Content-Type:"));
    }

    @Override
    protected HTMLTemplateContent createContent() {
        return new HTMLTemplateContent();
    }
View Full Code Here

        plainTextTemplate.setId("plainTextTemplate");

        AttachmentContent textAttachment = new AttachmentContent("testfile.txt");
        textAttachment.setId("textAttachment");

        HTMLTemplateContent htmlTemplate = new HTMLTemplateContent("mail/complexhtml.vm");
        htmlTemplate.setId("htmlTemplate");

        plainTextTemplate.setTemplateService(templateService);
        plainTextTemplate.setPullService(pullService);

        htmlTemplate.setTemplateService(templateService);
        htmlTemplate.setPullService(pullService);
        htmlTemplate.setResourceLoader(factory);
        htmlTemplate.addInlineResource("image", "/");

        textAttachment.setResourceLoader(factory);

        // 加入builder
        builder.setContent(attachable);
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.mail.builder.content.HTMLTemplateContent

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.