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
Log Doesn't Work in Production with Delayed Job
Expected #Count to Have Changed by 1, But Was Not Given a Block
In Ruby or Rails, Why Is "Include" Sometimes Inside the Class and Sometimes Outside the Class
What's the Best Background Job Management Library for Rails
How to Inherit from Nilclass or How to Simulate Similar Function
How to Stub a Method of an Included Module with Rspec
Ruby - Test Whether Database Connection Is Possible
Rails: Model Instance Method or Helper Method
How to Show Error Message on Rails Views
Installing Ruby Gem Less-Rails on Windows MAChine Using Therubyracer
How Can One Set Property Values When Initializing an Object in Ruby
Get Response Headers from Curb
Check If Array of Integers Increments in Ruby
Kill Process and Sub-Processes in Ruby on Windows
How to Deal with App_Key and App_Secret (Dropbox API)