mysociety / writetothem

Write to your MP, MEP, & other elected representatives.
https://www.writetothem.com
Other
54 stars 11 forks source link

Disallow sending of emails with no content #478

Closed MyfanwyNixon closed 2 years ago

MyfanwyNixon commented 2 years ago

We've had a few examples of messages to councillors that contain no content this week, and it's something I recall being reasonably common through the years.

Presumably this is a user error, although it seems like a baffling one given that the user is shown their 'message' and asked to confirm it both on the site and via the confirmation email.

Can we detect when there's no content between the salutation and the signature and prevent those messages being sent?

dracos commented 2 years ago

There already is such a check: https://github.com/mysociety/writetothem/blob/master/web/write.php#L206-L207 So I think I'd need to see actual examples to know if/why that's not firing.

dracos commented 2 years ago

Looks like there is a bug in that the ordering of the Dear line is not consistent, so if it's to multiple people and the check order differs from the submitted order, that counts as "editing" the content. Could change the check to not care what is on the Dear line easily enough I think.

dracos commented 2 years ago

Made it treat any Dear line as the same, so should count these blanks now.

MyfanwyNixon commented 2 years ago

Looks like another has come through somehow, today. ID 3f52f4a3c96d1ffef5f3.

dracos commented 2 years ago

Was tweaked to fix this