Fixed the issue of administrators receiving extra garbled emails.
This commit is contained in:
parent
66a5a5597b
commit
1ceb2abf34
|
|
@ -546,6 +546,8 @@ class AsksController < ApplicationController
|
||||||
referer_link = nil
|
referer_link = nil
|
||||||
end
|
end
|
||||||
mail_subject = mail_from+": #{t('ask.email_verification_notification')}"
|
mail_subject = mail_from+": #{t('ask.email_verification_notification')}"
|
||||||
|
|
||||||
|
|
||||||
email_er.email.update_attributes(
|
email_er.email.update_attributes(
|
||||||
:mail_lang=> site.default_locale,
|
:mail_lang=> site.default_locale,
|
||||||
:create_user=>(current_user rescue nil),
|
:create_user=>(current_user rescue nil),
|
||||||
|
|
@ -560,9 +562,9 @@ class AsksController < ApplicationController
|
||||||
"referer_link" => referer_link,
|
"referer_link" => referer_link,
|
||||||
"site_host" => host_url
|
"site_host" => host_url
|
||||||
},
|
},
|
||||||
:mail_reply_to => (manager_emails.empty? ? nil : manager_emails)
|
:mail_reply_to => nil
|
||||||
)
|
)
|
||||||
# email_er.email.deliver
|
email_er.email.deliver
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_email(email_er)
|
def build_email(email_er)
|
||||||
|
|
@ -581,7 +583,26 @@ class AsksController < ApplicationController
|
||||||
if host_url == "http://"
|
if host_url == "http://"
|
||||||
host_url = request.protocol + request.host_with_port
|
host_url = request.protocol + request.host_with_port
|
||||||
end
|
end
|
||||||
mail_subject = mail_from + " : " + email_er.category.title
|
mail_subject = mail_from + " : " + email_er.category.title
|
||||||
|
|
||||||
|
template_data = {
|
||||||
|
"title" => email_er.title,
|
||||||
|
"name" => email_er.name,
|
||||||
|
"identity" => email_er[:identity],
|
||||||
|
"mail" => email_er.mail,
|
||||||
|
"phone" => email_er.phone,
|
||||||
|
"serial_number" => email_er.get_serial_number,
|
||||||
|
"appointment" => email_er.appointment,
|
||||||
|
"disp_fields_infos" => @disp_fields_infos,
|
||||||
|
"ask_question_id" => email_er.id.to_s,
|
||||||
|
"site_host" => host_url,
|
||||||
|
"usage_rule" => @usage_rule
|
||||||
|
}
|
||||||
|
|
||||||
|
unless manager_emails.empty?
|
||||||
|
template_data["bcc_recipients"] = manager_emails.join(',')
|
||||||
|
end
|
||||||
|
|
||||||
email_er.email.update_attributes(
|
email_er.email.update_attributes(
|
||||||
:mail_lang=> site.default_locale,
|
:mail_lang=> site.default_locale,
|
||||||
:create_user=>(current_user rescue nil),
|
:create_user=>(current_user rescue nil),
|
||||||
|
|
@ -590,53 +611,12 @@ class AsksController < ApplicationController
|
||||||
:mail_to=>group_mail,
|
:mail_to=>group_mail,
|
||||||
:mail_subject=>mail_subject,
|
:mail_subject=>mail_subject,
|
||||||
:template=>'asks/email',
|
:template=>'asks/email',
|
||||||
:template_data=>{
|
:template_data=>template_data,
|
||||||
"title" => email_er.title,
|
|
||||||
"name" => email_er.name,
|
|
||||||
"identity" => email_er[:identity],
|
|
||||||
"mail" => email_er.mail,
|
|
||||||
"phone" => email_er.phone,
|
|
||||||
"serial_number" => email_er.get_serial_number,
|
|
||||||
# "fax" => email_er.fax,
|
|
||||||
# "content" => email_er.content
|
|
||||||
"appointment" => email_er.appointment,
|
|
||||||
"disp_fields_infos" => @disp_fields_infos,
|
|
||||||
"ask_question_id" => email_er.id.to_s,
|
|
||||||
"site_host" => host_url,
|
|
||||||
"usage_rule" => @usage_rule
|
|
||||||
},
|
|
||||||
:mail_reply_to => (manager_emails.empty? ? nil : manager_emails)
|
:mail_reply_to => (manager_emails.empty? ? nil : manager_emails)
|
||||||
)
|
)
|
||||||
if !manager_emails.empty?
|
|
||||||
Email.new(
|
|
||||||
:mail_lang=> site.default_locale,
|
|
||||||
:create_user=>(current_user rescue nil),
|
|
||||||
:mail_sentdate=>mail_sentdate,
|
|
||||||
:module_app=>@module_app,
|
|
||||||
:mail_to=>manager_emails,
|
|
||||||
:mail_subject=>mail_subject+" #{group_mail}",
|
|
||||||
:template=>'asks/email',
|
|
||||||
:template_data=>{
|
|
||||||
# "title" => email_er.title,
|
|
||||||
"name" => email_er.name,
|
|
||||||
"identity" => email_er[:identity],
|
|
||||||
"mail" => email_er.mail,
|
|
||||||
"phone" => email_er.phone,
|
|
||||||
"serial_number" => email_er.get_serial_number,
|
|
||||||
# "fax" => email_er.fax,
|
|
||||||
# "content" => email_er.content
|
|
||||||
"appointment" => email_er.appointment,
|
|
||||||
"disp_fields_infos" => @disp_fields_infos,
|
|
||||||
"ask_question_id" => email_er.id.to_s,
|
|
||||||
"site_host" => host_url,
|
|
||||||
"usage_rule" => @usage_rule,
|
|
||||||
"edit_url" => "#{host_url}/#{site.default_locale}/admin/asks/#{email_er.id}/edit"
|
|
||||||
}
|
|
||||||
).save
|
|
||||||
end
|
|
||||||
# email_er.email.deliver
|
|
||||||
end
|
|
||||||
|
|
||||||
|
email_er.email.deliver
|
||||||
|
end
|
||||||
def get_history
|
def get_history
|
||||||
question = AskQuestion.where(:serial_number => params["ticket_id"].to_i, :mail => params["email"]).first
|
question = AskQuestion.where(:serial_number => params["ticket_id"].to_i, :mail => params["email"]).first
|
||||||
if !question.nil?
|
if !question.nil?
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue