How to use a thin template for email text

I use slim as a template engine for my rails application and would like to use slim for mailing templates.

There is no problem with html mailer templates (views / mailer / default_email.en.html.slim), but I'm not sure how to make text templates work.

I placed the text template in the / mailer / default _email.en.text.slim views with this content:

Hello,

Your video is ready.
= @url

Thank you,
The A-Team

But the result is parsed as thin HTML and looks like this:

<Hello>,</Hello><Your>video is ready.</Your><Click>the link below to watch it:</Click>http://watch.thy/video<Thank>you,</Thank><The>A-Team</The>

Besides the prefix of each line with the channel, is there a more natural way? I even looked for a built-in plugin (for example, markdown one) to say "plain text", but it is not.

Thanks in advance.

+4
2

Slim HTML, , , .text.erb. ERB, .

+5

, Slim, :

|
  Hello,
  <br><br>
  Your video is ready.<br>
  #{@url}
  <br><br>
  Thank you,<br>
  The A-Team

eugen, text.erb . , - Slim.: -)

+5

Source: https://habr.com/ru/post/1622599/


All Articles