-
-
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.
chore: email setup no applicant bounty (#5062)
* chore: email setup no applicant bounty * mgmt command to select 0 app bounties and fire email * fix help text
- Loading branch information
1 parent
54efd11
commit f6d84e2
Showing
17 changed files
with
317 additions
and
43 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
''' | ||
Copyright (C) 2019 Gitcoin Core | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
''' | ||
from django.conf import settings | ||
from django.core.management.base import BaseCommand | ||
from django.db.models import Q | ||
from django.utils import timezone | ||
|
||
from dashboard.models import Bounty | ||
from marketing.mails import no_applicant_reminder | ||
|
||
|
||
class Command(BaseCommand): | ||
|
||
help = 'sends reminder emails to funders whose bounties have 0 applications' | ||
|
||
def handle(self, *args, **options): | ||
if settings.DEBUG: | ||
print("not active in non prod environments") | ||
return | ||
|
||
start_time_3_days = timezone.now() - timezone.timedelta(hours=24 * 3) | ||
end_time_3_days = timezone.now() - timezone.timedelta(hours=24 * 4) | ||
|
||
start_time_7_days = timezone.now() - timezone.timedelta(hours=24 * 7) | ||
end_time_7_days = timezone.now() - timezone.timedelta(hours=24 * 8) | ||
bounties = Bounty.objects.current().filter( | ||
network='mainnet', | ||
(Q(created_on__range=[end_time_3_days, start_time_3_days]) | Q(created_on__range=[end_time_7_days, start_time_7_days])) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
owocki
Contributor
|
||
idx_status='open', | ||
) | ||
|
||
for bounty in [b for b in bounties if b.no_of_applicants == 0]: | ||
no_applicant_reminder(bounty.bounty_owner_email, bounty) |
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
117 changes: 117 additions & 0 deletions
117
app/retail/templates/emails/bounty/no_applicant_reminder.html
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 |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{% extends 'emails/template.html' %} | ||
{% comment %} | ||
Copyright (C) 2019 Gitcoin Core | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
|
||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
{% endcomment %} | ||
{% load i18n humanize %} | ||
|
||
{% block content %} | ||
|
||
<style> | ||
h1 { | ||
font-size: 2rem; | ||
} | ||
|
||
h2 a { | ||
color: black; | ||
text-decoration: none; | ||
font-size: 1.5rem; | ||
font-weight: 300; | ||
} | ||
|
||
p { | ||
font-size: 1.1rem; | ||
font-weight: 300; | ||
max-width: 35rem; | ||
line-height: 25px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
.tag.token { | ||
background-color: #e7f0fa; | ||
color: #3E00FF; | ||
} | ||
|
||
.tag.usd { | ||
background-color: #d6fbeb; | ||
color: #00A55E; | ||
} | ||
|
||
.tag { | ||
text-align: center; | ||
margin: 4px; | ||
border-radius: 2px; | ||
padding: 3px 12px; | ||
cursor: pointer; | ||
white-space: nowrap; | ||
display: inline-block; | ||
} | ||
|
||
.tag p { | ||
font-weight: 500; | ||
font-size: 0.85rem; | ||
margin: 0; | ||
} | ||
|
||
.bounty-box { | ||
max-width: 50rem; | ||
} | ||
|
||
.btn-container { | ||
margin-top: 4rem; | ||
} | ||
</style> | ||
|
||
<div class="bounty-box"> | ||
<h1>Get more applicants on your bounty</h2> | ||
|
||
<p class="mb-0 mt-4">We noticed you dont have any contributors on your bounty.</p> | ||
<p class="mt-1"> | ||
Go to the Users Directory to discover and invite the best contributors | ||
for your bounty! | ||
</p> | ||
|
||
{% if bounty %} | ||
<img class="rounded mt-3" src="{{ bounty.avatar_url }}" width="100" height="100"> | ||
|
||
<h2> | ||
<a href="{{ bounty.absolute_url }}"> | ||
{{ bounty.title }} | ||
</a> | ||
</h2> | ||
|
||
<div class="tag token"> | ||
<p> | ||
<span>{{ bounty.token_name }}</span> | ||
<span>{{ bounty.value_true }}</span> | ||
</p> | ||
</div> | ||
|
||
<div class="tag usd"> | ||
<p> | ||
<span>{{ bounty.value_in_usdt_now }}</span> | ||
<span>USD</span> | ||
</p> | ||
</div> | ||
|
||
{% endif %} | ||
|
||
<p class="btn-container"> | ||
<a class="button" href="{{ directory_link }}">GO TO USERS DIRECTORY</a> | ||
</p> | ||
</div> | ||
{% endblock %} |
12 changes: 12 additions & 0 deletions
12
app/retail/templates/emails/bounty/no_applicant_reminder.txt
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% load humanize %} | ||
|
||
Get more applicant on your bounty! | ||
|
||
We noticed you dont have any contributors on your bounty | ||
Bounty Title : {{ bount.title }} | ||
Bounty Link : {{ bounty.absolute_url }} | ||
Bounty Amount : {{ bounty.value_true }} {{ bounty.token_name }} | ||
Bounty Amount (USD) : {{ bounty.value_in_usdt_now }} USD | ||
|
||
Go to the Users Directory {{ directory_link }} to discover and invite the best contributors | ||
for your bounty! |
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
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
Oops, something went wrong.
this file has a syntax error in it