On Friday, February 14, 2014 5:12:22 AM UTC-6, daynthan kabilan wrote:
>
> Hi Friends,
>
> how to add current user's email address for sender email using 
> actionmailer.
>
> *example*
> mail(:to => user.email, :subject => "Thank you.", :from => 
> "[email protected]<javascript:>
> ")
>

  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 

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/b253133d-e2b0-4012-be6a-c359fe1c9865%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to