Ruby on Rails Friday, February 14, 2014

Al
On Friday, February 14, 2014 3:18:29 PM UTC, James Davis, PhD wrote:

example
mail(:to => user.email, :subject => "Thank you.", :from => "a...@gmail.com")

  Would you happen to be using Devise?  If so, there is a current_user helper for accessing the user that is currently logged in. 

def thanks_message
mail to: user.email, subject: "Thank you.", from: current_user.email
 end 

 Although do note that this may cause your messages to be flagged as spam (because most domains use DKIM/SPF to specify which mail servers are authorized to send mail on their behalf, and in general you won't be authorized to send email from the user's domain.


Fred

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f9be9988-32ac-4ba2-9b60-e5a8e2dd83f9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment