Rails delayed_job sends email as HTML

Using delayed_job to send email files: filename.text.html.erb

Sometimes they appear in my inbox, which display correctly, and sometimes they appear as HTML code.

I notice that when I stop and run daemon delayed_job on the server, it seems to help in some cases, but not all the time.

Any ideas?

+3
source share
1 answer

In your postal class you need to set content_typeto text/htmlor text/plain. The code looks something like this:

class Postman < ActionMailer::Base
  # ...
  def foo_mail
    content_type 'text/html'
    # code
    end
  end
  # ...
end
+1
source

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


All Articles