-
-
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.
New Email for Tribe Members about Hackathon Prizes (#7146)
* setup web preview url * implement render_tribe_hackathon_prizes * add new email_header_hackathon.png banner image * build template for tribe_hackathon_prizes_email * management command for tribe_hackathon_prizes * setup cron job * email intro util function * rewrite tribe_hackathon_prizes() * rewrite render_tribe_hackathon_prizes() * rewrite web preview function * rewrite template()
- Loading branch information
1 parent
39aa579
commit 0632270
Showing
12 changed files
with
269 additions
and
2 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
41 changes: 41 additions & 0 deletions
41
app/marketing/management/commands/tribe_hackathon_prizes_email.py
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,41 @@ | ||
''' | ||
Copyright (C) 2020 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/>. | ||
''' | ||
import datetime | ||
|
||
from django.conf import settings | ||
from django.core.management.base import BaseCommand | ||
from django.utils import timezone | ||
|
||
from dashboard.models import HackathonEvent | ||
from marketing.mails import tribe_hackathon_prizes | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'sends emails for tribe members about hackathon prizes sponsored by the tribe org' | ||
|
||
def handle(self, *args, **options): | ||
if settings.DEBUG: | ||
print("not active in non prod environments") | ||
return | ||
|
||
no_of_days = 3 | ||
next_date = timezone.now() + timezone.timedelta(days=no_of_days) | ||
|
||
upcoming_hackthons = HackathonEvent.objects.filter(start_date__date=next_date) | ||
|
||
for upcoming_hackthon in upcoming_hackthons: | ||
try: | ||
tribe_hackathon_prizes(upcoming_hackthon) | ||
except: | ||
pass |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{% extends 'emails/template.html' %} | ||
{% comment %} | ||
Copyright (C) 2018 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> | ||
.sponsor-logo { | ||
width: 65px; | ||
height: 65px; | ||
margin: 20px 0; | ||
} | ||
.hackathon-image { | ||
width: 100%; | ||
height: 200px; | ||
margin-top: 30px; | ||
background-color: #000000; | ||
} | ||
.left { | ||
text-align: left; | ||
} | ||
.message { | ||
margin-top: 3em; | ||
margin-bottom: 0; | ||
} | ||
.container p a { | ||
color: #3E00FF; | ||
} | ||
.inner-container { | ||
width: 75%; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
</style> | ||
|
||
<div class="container" style="margin-bottom: 3em; padding: 0;"> | ||
<div class="inner-container"> | ||
{% for sponsor in sponsors_prizes %} | ||
<img class="sponsor-logo" src="{{sponsor.image_url}}"> | ||
{% endfor %} | ||
<h1>Win exciting prizes at {{ hackathon.name }}</h1> | ||
|
||
<p class="left message"><b>{{intro}}<b>{{ hackathon.name }}</b> 🚀</p> | ||
|
||
{% if hackathon %} | ||
{% if hackathon.image_url %} | ||
<img class="hackathon-image" src="{{hackathon.image_url}}"> | ||
{% endif %} | ||
<div style="margin-bottom: 2em; margin-top: 2em;"> | ||
<a class="button large" href="{{ hackathon.url }}">Join Hackathon</a> | ||
</div> | ||
{% endif %} | ||
|
||
<p class="left message">Meet a community of like-minded hackers, buidl cool stuff, and win these exciting prizes:</p> | ||
<div style="margin-bottom: 3em;"> | ||
{% for sponsor in sponsors_prizes %} | ||
{% if sponsor.prizes %} | ||
<div style="margin: 4em 0"> | ||
<h3 style="text-decoration: underline;">Bounties by {{sponsor.name}}:</h3> | ||
{% for prize in sponsor.prizes %} | ||
{% include 'emails/bounty.html' with bounty=prize count=forloop.counter small=1 prize=1 %} | ||
{% endfor %} | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
<p class="left" style="margin-top: 5em;">See you @ <a href="{{ hackathon.url }}">{{ hackathon.name }}</a>!</p> | ||
|
||
<p class="left">The Gitcoin team</p> | ||
</div> | ||
</div> | ||
{% endblock %} |
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,14 @@ | ||
Win exciting prizes with <br> {{ sponsor.name }} | ||
|
||
{{ sponsor.name }} is participating on a new hackathon on Gitcoin: {{ hackathon.name }} 🚀 | ||
|
||
{% if prizes %} | ||
Meet a community of like-minded hackers, buidl cool stuff, and win these exciting prizes: | ||
{% for prize in prizes %} | ||
{% include 'emails/bounty.html' with bounty=prize count=forloop.counter small=1 prize=1 %} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
See you @ {{ hackathon.name }}! | ||
|
||
The Gitcoin team |
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