Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated mailers for facilitator workshops #34638

Merged
merged 4 commits into from May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/oneoff/diff_email_previews
Expand Up @@ -26,6 +26,7 @@ PREVIEWS = %w(
exit_survey__csf_deepdive
exit_survey__csf_intro
exit_survey__csp_1
exit_survey__csp_for_returning_teachers
exit_survey__csp_summer_workshop
exit_survey__general
facilitator_detail_change_notification__csf_intro
Expand All @@ -46,12 +47,14 @@ PREVIEWS = %w(
teacher_enrollment_receipt__csf_deepdive
teacher_enrollment_receipt__csf_intro
teacher_enrollment_receipt__csp_1
teacher_enrollment_receipt__csp_for_returning_teachers
teacher_enrollment_receipt__csp_summer_workshop
teacher_enrollment_receipt__ecs_phase_4
teacher_enrollment_receipt__ecs_unit_3
teacher_enrollment_receipt__ecs_unit_4
teacher_enrollment_receipt__ecs_unit_5
teacher_enrollment_receipt__ecs_unit_6
teacher_enrollment_receipt__facilitator
teacher_enrollment_receipt__formatted_notes
teacher_enrollment_receipt__phase_2
teacher_enrollment_receipt_csd_1
Expand All @@ -65,8 +68,11 @@ PREVIEWS = %w(
teacher_enrollment_reminder__csf_intro_3_day
teacher_enrollment_reminder__csp_1_10_day
teacher_enrollment_reminder__csp_1_3_day
teacher_enrollment_reminder__csp_for_returning_teachers_10_day
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are just entries we forgot to add in previous PRs, yeah? No changes to CSP for returning teachers workshop mailers in this PR, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct - I didn't realize we had this script, and just ran across it while working on this update. I went ahead and updated the list of mailers it tests to reflect some recent additions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this script long ago to verify that email template changes don't have unexpected results. (For example, 1 partial template can be used in multiple emails that we are not aware of.) Not sure if it is helpful to anyone but me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems very useful, thanks Ha!

teacher_enrollment_reminder__csp_for_returning_teachers_3_day
teacher_enrollment_reminder__csp_summer_workshop_10_day
teacher_enrollment_reminder__csp_summer_workshop_3_day
teacher_enrollment_reminder__facilitator
teacher_enrollment_reminder_csd_1_10_day
teacher_enrollment_reminder_csd_1_3_day
teacher_enrollment_reminder_csd_unit_6_3_day
Expand Down
30 changes: 26 additions & 4 deletions dashboard/app/mailers/pd/workshop_mailer.rb
Expand Up @@ -42,11 +42,20 @@ def teacher_enrollment_receipt(enrollment)
@online_url = ONLINE_URL
@is_enrollment_receipt = true

# Facilitator training workshops use different email addresses
if @enrollment.workshop.course == Pd::Workshop::COURSE_FACILITATOR
from = from_facilitators
reply_to = from_facilitators
else
from = from_teacher
reply_to = email_address(@workshop.organizer.name, @workshop.organizer.email)
end

mail content_type: 'text/html',
from: from_teacher,
from: from,
subject: teacher_enrollment_subject(@workshop),
to: email_address(@enrollment.full_name, @enrollment.email),
reply_to: email_address(@workshop.organizer.name, @workshop.organizer.email)
reply_to: reply_to
end

def organizer_enrollment_receipt(enrollment)
Expand Down Expand Up @@ -98,13 +107,22 @@ def teacher_enrollment_reminder(enrollment, days_before: nil)
@pre_workshop_survey_url = enrollment.pre_workshop_survey_url
@is_first_pre_survey_email = days_before == INITIAL_PRE_SURVEY_DAYS_BEFORE

# Facilitator training workshops use a different email address
if @enrollment.workshop.course == Pd::Workshop::COURSE_FACILITATOR
from = from_facilitators
reply_to = from_facilitators
else
from = from_teacher
reply_to = email_address(@workshop.organizer.name, @workshop.organizer.email)
end

return if @workshop.suppress_reminders?

mail content_type: 'text/html',
from: from_teacher,
from: from,
subject: teacher_enrollment_subject(@workshop),
to: email_address(@enrollment.full_name, @enrollment.email),
reply_to: email_address(@workshop.organizer.name, @workshop.organizer.email)
reply_to: reply_to
end

def facilitator_enrollment_reminder(user, workshop)
Expand Down Expand Up @@ -251,6 +269,10 @@ def from_teacher
email_address('Code.org', 'teacher@code.org')
end

def from_facilitators
email_address('Code.org', 'facilitators@code.org')
end

def from_no_reply
email_address('Code.org', 'noreply@code.org')
end
Expand Down
@@ -0,0 +1,82 @@
- pre_work_url = 'https://docs.google.com/document/d/1mmBcMoRKO2TVxQSEEb-SxMnhuDZUkjE06tHa-8CGeyE/edit'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it expected that this is an /edit URL while the one just below is a /pub one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is as provided in spec, and there isn't currently a "published" version of this document. I'm asking Megan if she'd like to publish this doc too.

- zoom_download_url = 'https://zoom.us/download'
- learning_tips_url = 'https://docs.google.com/document/d/e/2PACX-1vQbiURoyzHZhWrmT8jbXq7QRiCMicUIO58EQQcw7aIPdZrxhfn1XP64djtg2TVFTsBNEUZnSYHSx4Lx/pub'
- digital_digest_url = 'https://bit.ly/summer-prep-sessions'

= render partial: 'workshop_logistics'

= render partial: 'workshop_notes'

%h3 Materials

%p
Please have the following with you on the day of your session to ensure you
are able to participate fully:

%ul
%li
Laptop and charger, as well as any adapters. Review
= link_to 'this page', Pd::WorkshopMailer::SUPPORTED_TECH_URL
for more information regarding compatible operating systems and browsers.
We do not recommend bringing a tablet as your primary device.
%li Download the Zoom app. (more information below)
%li Headphones or earphones. (optional)
%li Your curiosity and readiness to learn!

%h3 Complete your pre-work and download Zoom

%p
To prepare for our time together, we ask that you engage with your pre-work
materials (linked below), which should take about
%strong 90 minutes
to complete. We’ve designed these resources to help you prepare for summer
workshops given your region’s chosen delivery modality.

%p
= link_to 'Click here', pre_work_url
to access pre-work. Pre-work will be added as ready.

%p
All of our sessions will be taking place via Zoom, so we strongly recommend
that you
%strong
download the Zoom app
= surround '(', ' for download options)' do
= link_to 'click here', zoom_download_url
because it offers a more reliable connection than the standard browser AND
will allow you to fully participate in the activities we’ve planned. Be sure
to also check out our
= link_to 'Tips for Having a Great Virtual Learning Experience', learning_tips_url
for more information about steps you can take to prepare for our time together.

%h3 Visit and bookmark the Digital Digest

%p
We also ask that you take a few moments to check out and bookmark the
= link_to 'Digital Digest', digital_digest_url
= surround '(', ').' do
= link_to(digital_digest_url, digital_digest_url)
It will serve as your one-stop-shop for a ton of important information, such
as your pre-work, session join links, notes doc, and more!

%p
Keep an eye out for a calendar invite with the meeting link that will be sent
out roughly the week prior to the session.

%h3 Did something come up? If you can’t make it, let us know

%p
If for any reason, you can’t make it, please click this link to
= link_to 'cancel your registration', @cancel_url, target: "_blank"
so we can open up your spot to other interested educators.

%p
If you have any questions, reach out to us directly at
= link_to('facilitators@code.org', 'mailto:facilitators@code.org') + '.'

%p
Thank you,
%br
Megan Hochstatter
%br
Program Manager of K-12 Professional Learning Programs
Expand Up @@ -14,6 +14,10 @@
5-day Summer workshop on the Code.org
= @workshop.course
curriculum.
- elsif Pd::Workshop::COURSE_FACILITATOR == @workshop.course
%p
Thanks for enrolling in Code.org’s summer workshop prep session. We look
forward to seeing you there!
- else
%p
Thanks for enrolling in Code.org’s
Expand All @@ -32,5 +36,7 @@

-if [Pd::Workshop::COURSE_COUNSELOR, Pd::Workshop::COURSE_ADMIN].include? @workshop.course
= render partial: 'teacher_enrollment_details_counselor'
- elsif Pd::Workshop::COURSE_FACILITATOR == @workshop.course
= render partial: 'teacher_enrollment_details_facilitator'
-else
= render partial: 'teacher_enrollment_details'
Expand Up @@ -12,6 +12,10 @@
This is a reminder about your upcoming 5-day summer workshop on the Code.org
= @workshop.course
curriculum.
- elsif @workshop.course == Pd::Workshop::COURSE_FACILITATOR
%p
I wanted to remind you about your upcoming Code.org summer workshop prep
session.
- elsif @workshop.course == Pd::Workshop::COURSE_CSF
%p
I wanted to remind you about your upcoming Code.org
Expand Down Expand Up @@ -44,7 +48,7 @@
your workshop, reach out to your workshop organizer directly:
= "#{@organizer.name} at "
= mail_to @organizer.email, "#{@organizer.email}."
- else
- elsif @workshop.subject != Pd::Workshop::COURSE_FACILITATOR
%p
- if @workshop.course == Pd::Workshop::COURSE_CSF
This is a great step towards bringing computer science to your classroom!
Expand Down Expand Up @@ -74,5 +78,7 @@

-if [Pd::Workshop::COURSE_COUNSELOR, Pd::Workshop::COURSE_ADMIN].include? @workshop.course
= render partial: 'teacher_enrollment_details_counselor'
-elsif Pd::Workshop::COURSE_FACILITATOR == @workshop.course
= render partial: 'teacher_enrollment_details_facilitator'
-else
= render partial: 'teacher_enrollment_details'
9 changes: 9 additions & 0 deletions dashboard/test/mailers/previews/pd_workshop_mailer_preview.rb
Expand Up @@ -135,6 +135,15 @@ def teacher_enrollment_reminder__counselor
mail :teacher_enrollment_reminder, Pd::Workshop::COURSE_COUNSELOR
end

def teacher_enrollment_receipt__facilitator
mail :teacher_enrollment_receipt, Pd::Workshop::COURSE_FACILITATOR
end

def teacher_enrollment_reminder__facilitator
mail :teacher_enrollment_reminder, Pd::Workshop::COURSE_FACILITATOR,
options: {days_before: 10}
end

def teacher_enrollment_reminder__csp_for_returning_teachers_10_day
mail :teacher_enrollment_reminder, Pd::Workshop::COURSE_CSP, Pd::Workshop::SUBJECT_CSP_FOR_RETURNING_TEACHERS,
options: {days_before: 10}
Expand Down