fix email mail_from error
This commit is contained in:
parent
b176670943
commit
173a3ed90c
|
@ -91,18 +91,20 @@ class Admin::AsksController < OrbitAdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
locale = I18n.locale
|
||||||
@ask_question.destroy
|
@ask_question.destroy
|
||||||
redirect_to "/admin/asks"
|
redirect_to "/#{locale}/admin/asks"
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
locale = I18n.locale
|
||||||
ask_question_param = params.require(:ask_question).permit!
|
ask_question_param = params.require(:ask_question).permit!
|
||||||
@ask_question.update_attributes(ask_question_param)
|
@ask_question.update_attributes(ask_question_param)
|
||||||
if @ask_question.send_email?
|
if @ask_question.send_email?
|
||||||
build_email(@ask_question)
|
build_email(@ask_question)
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to admin_asks_path, notice: t('ask.reply_success')
|
redirect_to "/#{locale}/admin/asks", notice: t('ask.reply_success')
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_email(email_er)
|
def build_email(email_er)
|
||||||
|
@ -114,7 +116,11 @@ class Admin::AsksController < OrbitAdminController
|
||||||
@group_mail = email_er.mail
|
@group_mail = email_er.mail
|
||||||
@mail_sentdate = DateTime.now
|
@mail_sentdate = DateTime.now
|
||||||
|
|
||||||
|
site = Site.first
|
||||||
|
mail_from = site['title'][site['default_locale']]
|
||||||
|
|
||||||
email_er.email.update_attributes(
|
email_er.email.update_attributes(
|
||||||
|
:mail_from=> mail_from,
|
||||||
:create_user=>current_user,
|
:create_user=>current_user,
|
||||||
:mail_sentdate=>@mail_sentdate,
|
:mail_sentdate=>@mail_sentdate,
|
||||||
:module_app=>@module_app,
|
:module_app=>@module_app,
|
||||||
|
|
|
@ -191,7 +191,7 @@ class AsksController < ActionController::Base
|
||||||
@mail_sentdate = DateTime.now
|
@mail_sentdate = DateTime.now
|
||||||
|
|
||||||
site = Site.first
|
site = Site.first
|
||||||
mail_from = site['site_settings']['service_email']
|
mail_from = site['title'][site['default_locale']]
|
||||||
|
|
||||||
email_er.email.update_attributes(
|
email_er.email.update_attributes(
|
||||||
:mail_from=> mail_from,
|
:mail_from=> mail_from,
|
||||||
|
|
Loading…
Reference in New Issue