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
if @comment.save
Mailer.comment(@comment).deliver_now if email_on_debate_comment?
Mailer.reply(@comment).deliver_now if email_on_comment_reply?
Mailer.comment(@comment).deliver_later if email_on_debate_comment?
Mailer.reply(@comment).deliver_later if email_on_comment_reply?
else
render :new
end

View File

@@ -16,7 +16,7 @@ class Verification::EmailController < ApplicationController
@email = Verification::Email.new(@verified_user)
if @email.save
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)
else
redirect_to verified_user_path, alert: t('verification.email.create.alert.failure')