diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 54df8c71..87ad89cd 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -94,7 +94,7 @@ def page_params # teacher_snap: @teacher.snap, # teacher_school_website: @teacher.school.website, # piazza_password: Rails.application.secrets[:piazza_password], - # reason: @reason + # denial_reason: @denial_reason # }.with_indifferent_access # end diff --git a/app/controllers/teachers_controller.rb b/app/controllers/teachers_controller.rb index e178e976..cbcf35ba 100644 --- a/app/controllers/teachers_controller.rb +++ b/app/controllers/teachers_controller.rb @@ -130,7 +130,7 @@ def update def request_info @teacher.info_needed! if !params[:skip_email].present? - TeacherMailer.request_info_email(@teacher, params[:reason]).deliver_now + TeacherMailer.request_info_email(@teacher, params[:denial_reason]).deliver_now end redirect_to root_path end @@ -146,7 +146,7 @@ def deny @teacher.denied! if !params[:skip_email].present? # TODO: Update dropdown to select the email template. - TeacherMailer.deny_email(@teacher, params[:reason]).deliver_now + TeacherMailer.deny_email(@teacher, params[:denial_reason]).deliver_now end redirect_to root_path end diff --git a/app/mailers/teacher_mailer.rb b/app/mailers/teacher_mailer.rb index fe1904ec..4acb1634 100644 --- a/app/mailers/teacher_mailer.rb +++ b/app/mailers/teacher_mailer.rb @@ -16,18 +16,18 @@ def welcome_email(teacher) subject: email_template.subject end - def deny_email(teacher, reason) + def deny_email(teacher, denial_reason) @teacher = teacher - @reason = reason + @denial_reason = denial_reason set_body mail to: @teacher.email_name, cc: CONTACT_EMAIL, subject: email_template.subject end - def request_info_email(teacher, reason) + def request_info_email(teacher, request_reason) @teacher = teacher - @reason = reason + @request_reason = request_reason set_body mail to: @teacher.email_name, cc: CONTACT_EMAIL, @@ -48,7 +48,7 @@ def liquid_assigns base_rules = { bjc_password: Rails.application.secrets[:bjc_password], piazza_password: Rails.application.secrets[:piazza_password], - reason: @reason + denial_reason: @denial_reason } base_rules.merge!(@teacher.email_attributes) base_rules.with_indifferent_access diff --git a/db/seed_data.rb b/db/seed_data.rb index f08a9157..deccbc0d 100644 --- a/db/seed_data.rb +++ b/db/seed_data.rb @@ -27,7 +27,7 @@ module SeedData @basic_email_with_reason = <<-DENY_EMAIL

- {{ reason | strip_tags }} + {{ denial_reason | strip_tags }}

DENY_EMAIL @@ -38,7 +38,7 @@ module SeedData

[Your Name]

Below, you can find the reason as to why it was rejected

- {{ reason | strip_tags}} + {{ denial_reason | strip_tags}}

DENY_EMAIL1