现在可以通过rake redmine📧test[guange] 发送测试邮件
This commit is contained in:
parent
56f6fa0d86
commit
86347cab89
|
@ -817,12 +817,12 @@ class Mailer < ActionMailer::Base
|
||||||
headers[:references] = @references_objects.collect {|o| "<#{self.class.message_id_for(o)}>"}.join(' ')
|
headers[:references] = @references_objects.collect {|o| "<#{self.class.message_id_for(o)}>"}.join(' ')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_language_if_valid @initial_language
|
||||||
super headers do |format|
|
super headers do |format|
|
||||||
format.text
|
format.text
|
||||||
format.html unless Setting.plain_text_mail?
|
format.html unless Setting.plain_text_mail?
|
||||||
end
|
end
|
||||||
|
|
||||||
set_language_if_valid @initial_language
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(*args)
|
def initialize(*args)
|
||||||
|
|
|
@ -215,11 +215,12 @@ production:
|
||||||
# specific configuration options for development environment
|
# specific configuration options for development environment
|
||||||
# that overrides the default ones
|
# that overrides the default ones
|
||||||
development:
|
development:
|
||||||
delivery_method: :smtp
|
email_delivery:
|
||||||
smtp_settings:
|
delivery_method: :smtp
|
||||||
address: mail.trustie.net
|
smtp_settings:
|
||||||
port: 25
|
address: mail.trustie.net
|
||||||
domain: mail.trustie.net
|
port: 25
|
||||||
authentication: :login
|
domain: mail.trustie.net
|
||||||
user_name: "mail@trustie.net"
|
authentication: :login
|
||||||
password: "loong2010"
|
user_name: "mail@trustie.net"
|
||||||
|
password: "loong2010"
|
||||||
|
|
|
@ -186,9 +186,9 @@ END_DESC
|
||||||
|
|
||||||
ActionMailer::Base.raise_delivery_errors = true
|
ActionMailer::Base.raise_delivery_errors = true
|
||||||
begin
|
begin
|
||||||
Mailer.with_synched_deliveries do
|
# Mailer.with_synched_deliveries do
|
||||||
Mailer.test_email(user).deliver
|
Mailer.test_email(user).deliver!
|
||||||
end
|
# end
|
||||||
puts l(:notice_email_sent, user.mail)
|
puts l(:notice_email_sent, user.mail)
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
abort l(:notice_email_error, e.message)
|
abort l(:notice_email_error, e.message)
|
||||||
|
|
Loading…
Reference in New Issue