diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 6182e354c..3d908643f 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -136,7 +136,7 @@ class CropsController < ApplicationController end unless current_member.has_role? :crop_wrangler Role.crop_wranglers.each do |w| - Notifier.new_crop_request(w, @crop).deliver! + Notifier.new_crop_request(w, @crop).deliver_now! end end @@ -180,8 +180,8 @@ class CropsController < ApplicationController if previous_status == "pending" requester = @crop.requester new_status = @crop.approval_status - Notifier.crop_request_approved(requester, @crop).deliver! if new_status == "approved" - Notifier.crop_request_rejected(requester, @crop).deliver! if new_status == "rejected" + Notifier.crop_request_approved(requester, @crop).deliver_now! if new_status == "approved" + Notifier.crop_request_rejected(requester, @crop).deliver_now! if new_status == "rejected" end format.html { redirect_to @crop, notice: 'Crop was successfully updated.' } format.json { head :no_content } diff --git a/app/models/notification.rb b/app/models/notification.rb index 0668167f4..7b61e0c45 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -23,7 +23,7 @@ class Notification < ActiveRecord::Base def send_email if self.recipient.send_notification_email - Notifier.notify(self).deliver + Notifier.notify(self).deliver_now end end diff --git a/lib/tasks/growstuff.rake b/lib/tasks/growstuff.rake index 58372327a..5e0aa6d88 100644 --- a/lib/tasks/growstuff.rake +++ b/lib/tasks/growstuff.rake @@ -49,7 +49,7 @@ namespace :growstuff do if Date.today.cwday == send_on_day and Date.today.cweek % every_n_weeks == 0 Member.confirmed.find_each do |m| - Notifier.planting_reminder(m).deliver! + Notifier.planting_reminder(m).deliver_now! end end end diff --git a/spec/features/unsubscribing_spec.rb b/spec/features/unsubscribing_spec.rb index e8242f542..4b4981ad9 100644 --- a/spec/features/unsubscribing_spec.rb +++ b/spec/features/unsubscribing_spec.rb @@ -15,7 +15,7 @@ feature "unsubscribe" do expect(member.send_notification_email).to eq(true) # generate planting reminder email - Notifier.planting_reminder(member).deliver + Notifier.planting_reminder(member).deliver_now open_email(member.email) # clicking 'Unsubscribe' link will unsubscribe the member @@ -33,7 +33,7 @@ feature "unsubscribe" do # generate inbox notification email notification.recipient = member - Notifier.notify(notification).deliver + Notifier.notify(notification).deliver_now open_email(member.email) # clicking 'Unsubscribe' link will unsubscribe the member