Skip to content

Commit

Permalink
change reason to denial reason
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushC committed Feb 15, 2024
1 parent d35ca2c commit c343618
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/teachers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions app/mailers/teacher_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions db/seed_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module SeedData

@basic_email_with_reason = <<-DENY_EMAIL
<p>
{{ reason | strip_tags }}
{{ denial_reason | strip_tags }}
</p>
DENY_EMAIL

Expand All @@ -38,7 +38,7 @@ module SeedData
<p>[Your Name]</p>
<p>Below, you can find the reason as to why it was rejected </p>
<p>
{{ reason | strip_tags}}
{{ denial_reason | strip_tags}}
</p>
DENY_EMAIL1

Expand Down

0 comments on commit c343618

Please sign in to comment.