Another attempt at fxing the mailer

This commit is contained in:
Godwin
2016-07-02 13:56:03 -07:00
parent e5123a18e5
commit 433afaffe6
4 changed files with 33 additions and 18 deletions
+6 -6
View File
@@ -130,7 +130,7 @@ class ApplicationController < LinguaFrancaApplicationController
logger.info exception.to_s
logger.info exception.backtrace.join("\n")
UserMailer.error_report(
UserMailer.delay.error_report(
"A JavaScript error has occurred",
report,
params[:message],
@@ -138,7 +138,7 @@ class ApplicationController < LinguaFrancaApplicationController
request,
params,
current_user,
).deliver_now! if Rails.env.preview? || Rails.env.production?
) if Rails.env.preview? || Rails.env.production?
end
render json: {}
end
@@ -185,7 +185,7 @@ class ApplicationController < LinguaFrancaApplicationController
# send and email if this is production
suppress(Exception) do
UserMailer.error_report(
UserMailer.delay.error_report(
"An error has occurred in #{Rails.env}",
nil,
exception.to_s,
@@ -193,7 +193,7 @@ class ApplicationController < LinguaFrancaApplicationController
request,
params,
current_user,
).deliver_now! if Rails.env.preview? || Rails.env.production?
) if Rails.env.preview? || Rails.env.production?
end
# raise the error if we are in development so that we can debug it
@@ -335,7 +335,7 @@ class ApplicationController < LinguaFrancaApplicationController
def i18n_exception(str, exception, locale, key)
# send and email if this is production
suppress(Exception) do
UserMailer.error_report(
UserMailer.delay.error_report(
"A missing translation found in #{Rails.env}",
"<p>A translation for <code>#{key}</code> in <code>#{locale.to_s}</code> was found. The text that was rendered to the user was:</p><blockquote>#{str || 'nil'}</blockquote>",
exception.to_s,
@@ -343,7 +343,7 @@ class ApplicationController < LinguaFrancaApplicationController
request,
params,
current_user,
).deliver_now! if Rails.env.preview? || Rails.env.production?
) if Rails.env.preview? || Rails.env.production?
logger.info "Missing translation found for: #{key}"
end
end
+4 -4
View File
@@ -387,12 +387,12 @@ class ConferencesController < ApplicationController
@email_sent = :edit
elsif params[:button] == 'test'
@email_sent = :test
UserMailer.broadcast(
UserMailer.delay.broadcast(
"#{request.protocol}#{request.host_with_port}",
@subject,
@content,
current_user,
@this_conference).deliver_now!
@this_conference)
elsif params[:button] == 'preview'
@email_sent = :preview
elsif params[:button] == 'send'
@@ -1001,12 +1001,12 @@ class ConferencesController < ApplicationController
@broadcast_step = :preview
elsif params[:button] == 'test'
@broadcast_step = :test
UserMailer.broadcast(
UserMailer.delay.broadcast(
"#{request.protocol}#{request.host_with_port}",
@subject,
@body,
current_user,
@this_conference).deliver_now!
@this_conference)
end
return render 'conferences/register'
when 'locations'