-
-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
send alert for low priced bounty creation
- Loading branch information
Dan Lipert
committed
Dec 13, 2018
1 parent
366c40f
commit f2644fc
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -874,6 +874,29 @@ def setup_lang(to_email): | |
translation.activate(preferred_language) | ||
|
||
|
||
def low_bounty_alert(bounty): | ||
to_email = '[email protected]' | ||
from_email = bounty.bounty_owner_email or settings.SERVER_EMAIL | ||
cur_language = translation.get_language() | ||
try: | ||
setup_lang(to_email) | ||
subject = _("Low Bounty Alert") | ||
body_str = _("A low bounty was set from") | ||
body = f"{body_str} {bounty.bounty_owner_name} ({bounty.bounty_owner_email}):"\ | ||
f"{settings.BASE_URL}_administrationdashboard/bounty/{bounty.pk}/change\n\n"\ | ||
f"Github: {bounty.github_url}\n" | ||
send_mail( | ||
from_email, | ||
to_email, | ||
subject, | ||
body, | ||
from_name=_("No Reply from Gitcoin.co"), | ||
categories=['admin'], | ||
) | ||
finally: | ||
translation.activate(cur_language) | ||
|
||
|
||
def new_bounty_request(model): | ||
to_email = '[email protected]' | ||
from_email = model.requested_by.email or settings.SERVER_EMAIL | ||
|