Skip to content

Commit a9f907f

Browse files
committed
[Done] Fix mailers
1 parent 74094be commit a9f907f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+49
-141
lines changed

app/controllers/accounts_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def create
2727
end
2828
record_event('upgraded team')
2929

30-
Subscription.team_upgrade(current_user.username, @plan.id).deliver
30+
SubscriptionMailer.team_upgrade(current_user.username, @plan.id).deliver
3131
redirect_to new_team_opportunity_path(@team), notice: "You are subscribed to #{@plan.name}." + plan_capability(@plan, @team)
3232
else
3333
Rails.logger.error "Error creating account #{@account.errors.inspect}"

app/controllers/alerts_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def process_traction_alert(data)
4949
if can_report_traction?(data[:url])
5050
update_history
5151
Redis.current.set(last_sent_key(:traction, data[:url]), Time.now.to_i)
52-
Notifier.alert_admin(:traction, data[:url], data[:message]).deliver
52+
NotifierMailer.alert_admin(:traction, data[:url], data[:message]).deliver
5353
end
5454
end
5555

@@ -61,11 +61,11 @@ def process_google_analytics(data)
6161
if data[:viewers] > ENV['SITE_VISITORS_MAX_ALERT_LIMIT']
6262
update_history
6363
Redis.current.set(last_sent_key(:google_analytics), Time.now.to_i)
64-
Notifier.alert_admin(:a_lot_of_visitors, data[:url], message).deliver!
64+
NotifierMailer.alert_admin(:a_lot_of_visitors, data[:url], message).deliver!
6565
elsif data[:viewers] < ENV['SITE_VISITORS_MIN_ALERT_LIMIT']
6666
update_history
6767
Redis.current.set(last_sent_key(:google_analytics), Time.now.to_i)
68-
Notifier.alert_admin(:too_few_visitors, data[:url], message).deliver!
68+
NotifierMailer.alert_admin(:too_few_visitors, data[:url], message).deliver!
6969
end
7070
end
7171
end

app/controllers/emails_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ class EmailsController < ApplicationController
22
def unsubscribe
33
Rails.logger.info("Mailgun Unsubscribe: #{params.inspect}")
44
if mailgun?(ENV['MAILGUN_API_KEY'], params['token'], params['timestamp'], params['signature'])
5-
if params[:email_type] == Notifier::WELCOME_EVENT
5+
if params[:email_type] == NotifierMailer::WELCOME_EVENT
66
user = User.where(email: params[:recipient]).first
77
user.update_attribute(:receive_newsletter, false)
8-
elsif params[:email_type] == Notifier::ACTIVITY_EVENT
8+
elsif params[:email_type] == NotifierMailer::ACTIVITY_EVENT
99
user = User.where(email: params[:recipient]).first
1010
user.update_attribute(:notify_on_award, false)
11-
elsif params[:email_type] == Notifier::WEEKLY_DIGEST_EVENT
11+
elsif params[:email_type] == NotifierMailer::WEEKLY_DIGEST_EVENT
1212
user = User.where(email: params[:recipient]).first
1313
user.update_attribute(:receive_weekly_digest, false)
1414
end

app/controllers/opportunities_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def apply
1010
redirect_to_signup_if_unauthenticated(request.referer, "You must login/signup to apply for an opportunity") do
1111
job = Opportunity.find(params[:id])
1212
if current_user.apply_to(job)
13-
Notifier.new_applicant(current_user.username, job.id).deliver!
13+
NotifierMailer.new_applicant(current_user.username, job.id).deliver!
1414
record_event('applied to job', job_public_id: job.public_id, 'job team' => job.team.slug)
1515
end
1616
respond_to do |format|

app/controllers/protips_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def report_inappropriate
267267

268268
if cookies["report_inappropriate-#{protip_public_id}"].nil?
269269
opts = { reporting_user: viewing_user, ip_address: request.remote_ip, protip_public_id: protip_public_id }
270-
report_inappropriate_mailer = ::Abuse.report_inappropriate(opts)
270+
report_inappropriate_mailer = ::AbuseMailer.report_inappropriate(opts)
271271
report_inappropriate_mailer.deliver
272272

273273
cookies["report_inappropriate-#{protip_public_id}"] = true

app/controllers/redemptions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def show
55
@redemption.award!(current_user)
66
if current_user.pending?
77
current_user.activate!
8-
Notifier.welcome_email(current_user.username).deliver
8+
NotifierMailer.welcome_email(current_user.username).deliver
99
RefreshUserJob.perform_async(current_user.username)
1010
end
1111
redirect_to(destination_url)

app/controllers/teams_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def inquiry
166166

167167
current_user.seen(:inquired) if signed_in?
168168
record_event('inquired about team page')
169-
Notifier.new_lead(current_user.try(:username), inquiry_params[:email], inquiry_params[:company]).deliver
169+
NotifierMailer.new_lead(current_user.try(:username), inquiry_params[:email], inquiry_params[:company]).deliver
170170
render :layout => 'product_description'
171171
end
172172

app/jobs/activate_user_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def perform(username, always_activate=true)
88
RefreshUserJob.new.perform(username)
99
unless user.badges.empty?
1010
user.activate!
11-
Notifier.welcome_email(username).deliver
11+
NotifierMailer.welcome_email(username).deliver
1212
end
1313
end
1414
end

app/mailers/abuse.rb renamed to app/mailers/abuse_mailer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Abuse < ActionMailer::Base
1+
class AbuseMailer < ActionMailer::Base
22
include ActionView::Helpers::TextHelper
33
include ActiveSupport::Benchmarkable
44

app/mailers/campaigns.rb

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)