如何在我的电子邮件邮件程序中更改此代码,以便当 current_user 从应用程序发出电子邮件时,收件人会收到它:from => current_user.email。
目前它来自“notification@example.com”,但我希望它能够动态更改,这是否可能不会导致电子邮件进入垃圾邮件?
class EmailMailer < ActionMailer::Base
default :from => "notification@example.com"
def email_listing(user, listing, email)
@user = user
@listing = listing
@email = email
@url = "www.example.com"
mail(:to => @email.email, :subject => @user.name)
end
end