我有必要这样做,因为对我来说这似乎合乎逻辑:
def notification(vehicle)
@vehicle = vehicle
mail(:to => @vehicle.owner.email_address, :template_name => "n_o")
mail(:to => @vehicle.booker.email_address, :template_name => "n_b")
end
问题是:我只收到last电子邮件。因此,在上面的示例中,只有预订者会收到电子邮件,而不会向所有者发送任何内容。
问题是什么 ?怎么解决呢?我应该创建两个单独的邮件功能,例如 notification_owner(vehicle) 和 notification_booker(vehicle),还是有更简单的解决方案?
Thanks!
好的。所以,愚蠢的我,我忘了提及我正在处理delayed_jobs gem。所以,问题是,我忘记指定“.deliver!”每个“邮件”功能之后的操作。
所以,它应该看起来像这样:
mail(:to => @vehicle.owner.email_address, :template_name => "n_o").deliver!
mail(:to => @vehicle.booker.email_address, :template_name => "n_b").deliver!
但仍然。感谢您的支持!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)