Rails - Sendgrid: Emails using html.erb files instead of plain html

367 views Asked by At

I am using Sendgrid to send emails with my backend on Rails 5. I manage to send plain html files, but I can't send html.erb files. In general it works, but the embedded ruby doesn't take effect.

html.erb file:

<h1>Count <%= 2+2 %></h1>

Actual Output

Count <%= 2+2 %>

Desired Output

Count 4

The emails do deliver to my inbox.

I tried following this tutorial https://sendgrid.com/docs/Integrate/Frameworks/rubyonrails.html but that doesn't deliver emails at all. What does work is using the gem with the API key https://github.com/sendgrid/sendgrid-ruby

0

There are 0 answers