-
-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pause donations option for Goal #1999
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user's profile and /donate
page also need to be modified to expose the fact that donations are paused.
www/%username/giving/index.html.spt
Outdated
@@ -290,6 +290,10 @@ next_payday = compute_next_payday_date() | |||
<p class="text-warning">{{ glyphicon('warning-sign') }} {{ _( | |||
"Inactive because the account of the recipient is closed." | |||
) }}</p> | |||
% elif tippee.goal == -2 | |||
<p class="text-warning">{{ glyphicon('warning-sign') }} {{ _( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pause
icon should probably be used instead of warning-sign
, and perhaps the text style should be text-info
instead of text-warning
.
recipient=self.username, | ||
donations_paused=donations_paused, | ||
donations_url=tipper.url('giving/') | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't send a potentially large number of emails while processing a user request. Firstly because the request will time out, secondly because it can allow an attacker to flood users with duplicate emails, and thirdly because the user should be able to reverse their decision before the emails are sent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be accomplished by using Participant's notify() method? Also when I switched to using notify(), the request seemed to get stuck. Do you know why this might be happening?
also for the last point
thirdly because the user should be able to reverse their decision before the emails are sent
If a decision is reversed, what should occur? Do the emails that were queued to send get dequeued?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The notify
method should be used, but in a separate function which would be either a payday method or a cron job, like send_donation_reminder_notifications
or send_account_disabled_notifications
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also when I switched to using notify(), the request seemed to get stuck. Do you know why this might be happening?
update_goal
runs in a database transaction (which is confusingly called a "cursor" for legacy reasons), but notify
doesn't, so if you tried to call notify
from inside the with
block you could have created a "deadlock" (two database workers trying to modify the same row, each one waiting for the other to complete its transaction before continuing).
If a decision is reversed, what should occur? Do the emails that were queued to send get dequeued?
No. Once the email is queued for sending we don't cancel it. What we do instead is delay the creation of the notification which results in the email being queued for sending. Donors don't need to be notified immediately that donations have been paused, this kind of information can be delayed for an hour or even a week.
|
In username > edit > goal, there is an option to pause donations on individual accounts. When the pause option is selected, all patrons are notified of the pause (except if the previous goal was "I'm here as a patron, and politely decline to receive gifts. "). When the goal is updated to no longer be paused, all patrons are notified again (except if the new goal is "I'm here as a patron, and politely decline to receive gifts. ").
Closes #1745.