Conversation
struan
left a comment
There was a problem hiding this comment.
I'm afraid the template changes here aren't going to work because they're not parsed as php.
Would also be nice to add something to bin/test-run to check that something is sent, and that only one is sent. I suspect you can crib the code from do_send_example_message and update do_send_group_message accordingly
| @@ -1,11 +1,27 @@ | |||
| <?=$values['weeks_ago']?> weeks ago we sent your letter to <?=$values['recipient_name']?>, your | |||
| <?=$values['recipient_position']?>. (For reference, there's a copy of your | |||
| <?=$values['weeks_ago']?> weeks ago we sent your letter to <?php if ($values['is_multi']) { ?>your <?=$values['recipient_position_plural']?><?php } else { ?><?=$values['recipient_name']?>, your | |||
There was a problem hiding this comment.
These are parsed by mySociety::Email.pm so only do simple substitution so php tags will be included verbatim. If you want to do this you'll either need a separate template for multi person messages or do the logic in the code.
| // Check if this is a multi-recipient message | ||
| $is_multi = false; | ||
| if (!$preview) { | ||
| $is_multi = msg_is_multi_questionnaire_message($token) ? true : false; |
There was a problem hiding this comment.
could you not do msg_is_multi_questionnaire_message($token) == 1 here to be explicit and also skip the ternary?
Implements #536
The problem is we don't survey messages sent to multiple people (because originally the key question was about if one person wrote back). Now most questions are about the sender - and in Wales it's only going to be a multi-member constituency, so we want to make sure we are capturing this if people are using the option (especially if they're more likely to use if if they don't know who to write to).
Basically the key thing is a change in the queue that sets no_questionnaire to true for all but the first message in a group block.
Then there's a number of changes to the content:
I've tested this as far as I can on the survey side - but will need some help to test the queue bit.