Removes one liner mailing list?

How to send an email in one line without creating an email program class?

I need to set all parameters, including: from (which is different from smtp user)

So far, I got this:

# ok not exactly a one liner, but it doesn't matter ActionMailer::Base.mail(:from => ' admin@mysite.me ', :to => ' someone@gmail.com ', :subject => 'subject bla') do 'content bla' end.deliver 

Content does not work, I get an empty email

+6
source share
1 answer
 ActionMailer::Base.mail(from: ' from@domain.com ', to: ' to@domain.com ', subject: "Welcome to My Awesome Site", body: 'I am the email body.').deliver 

Omg, we have one line!

+18
source

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


All Articles