Examples of MailTemplate


Examples of org.olat.core.util.mail.MailTemplate

   * @param subject
   * @param body
   * @return
   */
  private MailTemplate createMailTemplate(String subject, String body) {   
    return new MailTemplate(subject, body, null) {
      @Override
      public void putVariablesInMailContext(VelocityContext context, Identity identity) {
        context.put("firstname", identity.getUser().getProperty(UserConstants.FIRSTNAME, null));
        context.put("lastname", identity.getUser().getProperty(UserConstants.LASTNAME, null));
        context.put("username", identity.getName());
View Full Code Here

Examples of org.olat.core.util.mail.MailTemplate

        plaintext.append(subitem.getDescription());
      }
      plaintext.append("\n\n");
    }
    String mailText = plaintext.toString();
    MailTemplate mailTempl = new MailTemplate(title, mailText, null) {

      @Override
      public void putVariablesInMailContext(VelocityContext context, Identity recipient) {
      // nothing to do
      }
View Full Code Here

Examples of org.structr.core.entity.MailTemplate

    final DecimalFormat numberFormat2 = new DecimalFormat("0000.0000", DecimalFormatSymbols.getInstance(Locale.GERMAN));
    final DecimalFormat numberFormat3 = new DecimalFormat("####", DecimalFormatSymbols.getInstance(Locale.SIMPLIFIED_CHINESE));
    final String numberString1        = numberFormat1.format(2.234);
    final String numberString2        = numberFormat2.format(2.234);
    final String numberString3        = numberFormat3.format(2.234);
    MailTemplate template             = null;
    MailTemplate template2             = null;
    TestOne testOne                   = null;
    TestTwo testTwo                   = null;
    TestThree testThree               = null;
    TestFour testFour                 = null;
    List<TestSix> testSixs            = null;
    int index                         = 0;

    try (final Tx tx = app.tx()) {

      testOne        = createTestNode(TestOne.class);
      testTwo        = createTestNode(TestTwo.class);
      testThree      = createTestNode(TestThree.class);
      testFour       = createTestNode(TestFour.class);
      testSixs       = createTestNodes(TestSix.class, 20);

      for (final TestSix testSix : testSixs) {
        testSix.setProperty(TestSix.index, index++);
      }

      // create mail template
      template = createTestNode(MailTemplate.class);
      template.setProperty(MailTemplate.name, "TEST");
      template.setProperty(MailTemplate.locale, "en_EN");
      template.setProperty(MailTemplate.text, "This is a template for ${this.name}");

      // create mail template
      template2 = createTestNode(MailTemplate.class);
      template2.setProperty(MailTemplate.name, "TEST2");
      template2.setProperty(MailTemplate.locale, "en_EN");
      template2.setProperty(MailTemplate.text, "${this.aDouble}");

      // check existance
      assertNotNull(testOne);

      testOne.setProperty(TestOne.name, "A-nice-little-name-for-my-test-object");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.