Skip to content

Conversation

TurnerRiley
Copy link
Contributor

@TurnerRiley TurnerRiley commented Sep 5, 2025

The issue of why certain MailJet emails weren't sending was likely that nil fields weren't able to be processed by MailJet, which expects string values. Since I was testing the 3-/10-day reminder and the post-workshop survey emails locally, I always included the test regional partner and test facilitator I created locally out of habit since I knew they wouldn't actually receive emails (since the emails were fake). However, when I tested on production, I didn't use a regional partner or facilitator in the workshops because I didn't want to send real RP's and facilitators test emails, and I believe this caused the rp_name, facilitator_names, etc. variables to be nil rather than empty strings which threw an error in the email.

Production investigation

I was able to confirm this on production and locally when manually triggering send_exit_surveys. When there was an empty field (such as rp_name), MailJet threw an error:
null values

However, once those fields were filled in and I tried again, I saw a success (and an email in my inbox):
successful send after setting rp values

Test locally

I created a workshop with the bare minimum fields it would let me create it with to test.

I first confirmed that locally I would see the same error with missing fields:
confirm locally

Then, I added fallback string values for fields that could possibly be nil and tested again (this time, seeing the email):
sent email TADA

This PR's changes

This PR adds in the fallback values but still keeps sending the post-workshop survey behind the DCDO flag just to be safe. Once I can confirm that it's working on production as expected, we can do the rollout of the new MailJet email for all users.

Links

Jira ticket: here

Testing story

Local testing.

Follow-up work

Once I confirm this works on production as well, we can start rolling out the new PD MailJet emails.

@TurnerRiley TurnerRiley requested a review from a team September 5, 2025 18:52
Copy link
Contributor

@drizco drizco left a comment

Choose a reason for hiding this comment

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

nice! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants