sends custom emails with delayed jobs

This commit is contained in:
rgarcia
2015-09-03 22:48:29 +02:00
parent 8a950761d3
commit d0d33cc517
2 changed files with 3 additions and 3 deletions

View File

@@ -8,8 +8,8 @@ class CommentsController < ApplicationController
def create def create
if @comment.save if @comment.save
Mailer.comment(@comment).deliver_now if email_on_debate_comment? Mailer.comment(@comment).deliver_later if email_on_debate_comment?
Mailer.reply(@comment).deliver_now if email_on_comment_reply? Mailer.reply(@comment).deliver_later if email_on_comment_reply?
else else
render :new render :new
end end

View File

@@ -16,7 +16,7 @@ class Verification::EmailController < ApplicationController
@email = Verification::Email.new(@verified_user) @email = Verification::Email.new(@verified_user)
if @email.save if @email.save
current_user.reload current_user.reload
Mailer.email_verification(current_user, @email.recipient, @email.encrypted_token).deliver_now Mailer.email_verification(current_user, @email.recipient, @email.encrypted_token).deliver_later
redirect_to account_path, notice: t('verification.email.create.flash.success', email: @verified_user.email) redirect_to account_path, notice: t('verification.email.create.flash.success', email: @verified_user.email)
else else
redirect_to verified_user_path, alert: t('verification.email.create.alert.failure') redirect_to verified_user_path, alert: t('verification.email.create.alert.failure')