title: How to process TXT e-mail template with Thymeleaf?
body: <p>I'm trying to send <code>plain text</code> email from Spring application with Thymeleaf.</p>
  
  <p>This is my e-mail service:</p>
  
  <pre><code>@Override
  public void sendPasswordToken(Token token) throws ServiceException {
      Assert.notNull(token);
  
      try {
  
          Locale locale = Locale.getDefault();
  
          final Context ctx = new Context(locale);
          ctx.setVariable("url", url(token));
  
          // Prepare message using a Spring helper
          final MimeMessage mimeMessage = mailSender.createMimeMessage();
  
          final MimeMessageHelper message = new MimeMessageHelper(
                  mimeMessage, false, SpringMailConfig.EMAIL_TEMPLATE_ENCODING
          );
  
          message.setSubject("Token");
          message.setTo(token.getUser().getUsername());
  
          final String content = this.textTemplateEngine.process("text/token", ctx);
          message.setText(content, false);
  
          mailSender.send(mimeMessage);
  
      } catch (Exception e) {
          throw new ServiceException("Token has not been sent", e);
      }
  }
  </code></pre>
  
  <p>email is sent and delivered into mailbox. </p>
  
  <p>This is my <code>plain text</code> email template:</p>
  
  <blockquote>
    <p>Token url: ${url}</p>
  </blockquote>
  
  <p>but in delivered mailbox <code>url</code> variable is not replaced with it's value. Why? </p>
  
  <p>When I use <code>html</code> classic HTML Thymeleaf syntax, variable is replaced:</p>
  
  <pre><code>&lt;span th:text="${url}"&gt;&lt;/span&gt;
  </code></pre>
  
  <p><strong>What is proper syntax for e-mail text template?</strong></p>