slime-lang / phoenix_slime

Phoenix Template Engine for Slime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot render template for Bamboo

dannote opened this issue · comments

I'm trying to use Slime templates in Bamboo and here is what I get. I suppose that render_to_string expects a binary, not a safe string. Phoenix.Template.EExEngine works fine here.

Request: POST /lead/join
** (exit) an exception was raised:
    ** (ArgumentError) argument error
        :erlang.iolist_to_binary({:safe, ["" | "a"]})
        (phoenix) lib/phoenix/view.ex:342: Phoenix.View.render_to_string/3
        (bamboo) lib/bamboo/phoenix.ex:247: Bamboo.Phoenix.render_html_and_text_emails/1

Thanks for the report @dannote! I haven't personally used PhoenixSlim + Bamboo, might you have a example project I can bang on? Additionally, is this something you'd be keen to try and fix?