How to Integrate 'Premailer' with Rails

How to Integrate 'premailer' with Rails

Try:

def premailer(message)
message.text_part.body = Premailer.new(message.text_part.body.to_s, with_html_string: true).to_plain_text
message.html_part.body = Premailer.new(message.html_part.body.to_s, with_html_string: true).to_inline_css

return message
end

def welcome(user)
@user = user

message = mail to: user.email, subject: "Welcome"
end

How do I force premailer to send a plaintext email?

I deleted the .html.erb template and it automatically sends only plaintext emails!



Related Topics



Leave a reply



Submit