This PR adds a new mailing, with a rake task that should be run on a schedule (see svsticky/sadserver/pull/390 for the accompanying server PR).
This email summarizes all open payments and asks users to pay this asap via the payment portal.
The email looks like this:
Unlike the other mailings, the text version of the email is rendered from a template instead of a heredoc, which in my opinion is cleaner.
This PR also changes some things outside of the mailers:
The unused Member.payable_unpaid_activities has been removed
Member.debtors has been added, which returns a list of all members that have open payments.
Member.participant_by_activity has been added, which returns the participant object that belongs to the member and the given activity. This method should be used carefully: don't pass an activity that the member is not a participant of.
If the member does not have a user account (and thus no language preference set), the language preference is defaulted to Dutch.
The check if a Mailgun token is available in the environment has been moved to the common mail and mails methods.
This PR does not:
Change the definition of defaulters (wanbetalers) to people to that ignored the new payment emails for a month. The current definition of defaulters is something like: people that received 4 'inform' emails.
Change the default text for the 'inform' emails to something unrelated to payments.
Remove the dropdown option for 'no_payers' ('NOG BETALERS') in the 'inform' email editor.
Update the definition of unpaid activities on the admins' payment page to align with the definition used in the email (debtors).
Add a list of expired, but not yet set to payable activities to the admins' payment page (which helps the treasurer to find those activities).
Move all mailings to using text templates.
All of these should probably be done sometime in the future, but seem out of scope for the current PR (TODO: make issues for these things).
This PR adds a new mailing, with a rake task that should be run on a schedule (see svsticky/sadserver/pull/390 for the accompanying server PR). This email summarizes all open payments and asks users to pay this asap via the payment portal. The email looks like this:
Unlike the other mailings, the text version of the email is rendered from a template instead of a heredoc, which in my opinion is cleaner.
This PR also changes some things outside of the mailers:
Member.payable_unpaid_activities
has been removedMember.debtors
has been added, which returns a list of all members that have open payments.Member.participant_by_activity
has been added, which returns the participant object that belongs to the member and the given activity. This method should be used carefully: don't pass an activity that the member is not a participant of.mail
andmails
methods.This PR does not:
debtors
).All of these should probably be done sometime in the future, but seem out of scope for the current PR (TODO: make issues for these things).