0
ERS, 每当我的应用程序发送一个纯文本电子邮件,通知对各种事物的人的电子邮件作为两个不同的电子邮件解释或收到一些电子邮件客户端。它适用于Gmail和comcast。通过虚拟主机随附的通用主机获得电子邮件的用户将收到两封具有相同纯文本电子邮件的电子邮件。这非常烦人。我将不胜感激。直到修复我才能启动。请赐予你强大的智慧!我喜欢这个网站!电子邮件被解释为两个电子邮件
配置/初始化/为setup_mail.rb
ActionMailer::Base.default_content_type = "text/plain"
配置/环境/ production.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "mail.xxxessment.com",
:port => 26,
:domain => "www.xxxessment.com",
:user_name => "systemadmin+xxxessment.com",
:password => "secret",
:authentication => "plain",
:enable_starttls_auto => false
}
型号/ actionitem_observer.rb
def after_save(actionitem)
if actionitem.responsible_id_changed? and !actionitem.responsible_id.nil?
Notifier.deliver_responsible_alert(actionitem, actionitem.responsible.email)
end
end
邮寄/ notifier.rb
def responsible_alert(actionitem,responsible_email)
subject "New action item assignment from xxxxx Assessment"
from "[email protected]"
recipients responsible_email
sent_on Time.zone.now
content_type "text/plain"
body :actionitem => actionitem
end
的意见/通知/ responsible_alert.text.erb
You have been assigned Action Item #<%= @actionitem.id %> in the xxxessment system.
Action Item: <%= @actionitem.name %>
Please login in and look at the My Action Items tab to find the new item.
Thank you.