From 4ce4a2d1f2913b925195f55c865eda1d59751a5f Mon Sep 17 00:00:00 2001 From: Jingchao Zhong <92573736+perryzjc@users.noreply.github.com> Date: Tue, 20 Feb 2024 07:31:02 -0800 Subject: [PATCH 1/8] Add request reason email template --- db/seed_data.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/db/seed_data.rb b/db/seed_data.rb index deccbc0d..934512f8 100644 --- a/db/seed_data.rb +++ b/db/seed_data.rb @@ -59,6 +59,15 @@ module SeedData DENY_EMAIL3 + @request_info_email = <<-REQUEST_INFO_EMAIL +
+ Here is an update to your application to BJC:
+ We need more information from you:
+ {{ request_reason | strip_tags }}
+ To update your application, please login to your account and update your application.
+
{{denial_reason}}
{{request_reason}}
- Here is an update to your application to BJC:
- We need more information from you:
- {{ request_reason | strip_tags }}
- To update your application, please login to your account and update your application.
-
Dear {{teacher_first_name}},
+ +We hope this message finds you well. We're writing to you regarding your ongoing application with BJC. As part of our review process, we've identified that some additional information is required to move forward.
+ +Required Information:
+ We kindly ask you to provide the following details to complete your application:
{{ request_reason | strip_tags }}
+ +To submit the requested information, please follow these steps:
+Thank you for your attention to this matter. We look forward to receiving the additional information and advancing your application process.
+ +Warm regards,
+[Your Name]
REQUEST_INFO_EMAIL + def self.emails [ { From f99087d7f2ebe9274f7176497b7d19e5fb207414 Mon Sep 17 00:00:00 2001 From: Jingchao Zhong <92573736+perryzjc@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:55:49 -0800 Subject: [PATCH 5/8] Add rspec test for request reason email --- spec/mailers/teacher_mailer_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index d9db4aab..b6293eec 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -36,4 +36,17 @@ expect(email.to[0]).to eq("lmock@berkeley.edu") expect(email.body.encoded).to include("Short Long") end + + it "Sends Request Info Email" do + teacher = teachers(:long) + email = TeacherMailer.request_info_email(teacher, "Request Reason") + email.deliver_now + expect(email.from[0]).to eq("contact@bjc.berkeley.edu") + expect(email.to[0]).to eq("short@long.com") + expect(email.subject).to eq("Request Info Email") + # Test appearance of first_name + expect(email.body.encoded).to include("Short") + expect(email.body.encoded).to include("Request Reason") + expect(email.body.encoded).to include("We're writing to you regarding your ongoing application with BJC.") + end end From 9248494ccbe925f6394a527d0f3b884391397d29 Mon Sep 17 00:00:00 2001 From: razztech