Repository navigation
Conversation
GMC never sends the template MX-C-1S10 alone: the name has the country before and a version after (UG-C-1S10-2, TG-G-1S10-1...), so no letter was ever marked as a Compassion Moment. Every template containing -1S10- (C and G families) is now a Compassion Moment. An empty template falls back to our own template instead of crashing. Assisted-by: claude-opus-5-5, medium, claude-code
The first-letter check looked at all the letters of the batch: one new sponsor's first letter gave the first-letter communication to every partner of the batch, and no Compassion Moment was used.
[Medium impact] This PR appears safe to merge. Reviews (1) · Last reviewed commit: "[T3477] Letter communication: first lett..." · Reviewed by Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The "B2S Compassion Moment" communication (
child_letter_moment_config) was never used.sbc_compassionsetis_compassion_momentonly when the GMC template was exactlyMX-C-1S10. GMC never sends that name: it puts the country before the code and a version after it (UG-C-1S10-2,MX-C-1S10-2,TG-G-1S10-1...). No letter was ever marked as a Compassion Moment.partner_communication_compassionsend_communicationdecided "first letter" on all the letters of the batch, not on the letters of the partner. One first letter (new sponsor) in a batch gave the first-letter communication to every partner of the batch, and no Compassion Moment was used for them.Changes
Commit 1: sbc_compassion, every 1S10 template is a Compassion Moment
json_to_data:is_compassion_momentis true when the template name contains-1S10-. Both families (XX-C-1S10-nandXX-G-1S10-n) are Compassion Moments.Template(Noneor"") falls back to our own template like a missing key, instead of crashing.UG-C-1S10-2,TG-G-1S10-1,MX-C-1S10-2, and non-1S10 ones).Commit 2: partner_communication_compassion, first letter per partner
send_communication:is_firstis computed on the letters of the partner in the loop.Letters already received
No data change: their communication is already created or sent.
Tests
sbc_compassion:TestCompassionMomentpartner_communication_compassion:TestSendCommunicationBoth test classes are
post_installand need no demo data, so they also run on a copy of production without-u. Run on a copy of production: 4/4 pass. With the commit 2 change reverted,TestSendCommunicationfails: partner B gets the first-letter communication instead of the Compassion Moment.