-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
New Email for Tribe Members about Hackathon Prizes #7146
Merged
thelostone-mc
merged 11 commits into
gitcoinco:master
from
sebastiantf:tribe-hackathon-prizes-email
Sep 30, 2020
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1e8d208
setup web preview url
sebastiantf 79fbc4c
implement render_tribe_hackathon_prizes
sebastiantf eb1fe5b
add new email_header_hackathon.png banner image
sebastiantf e874005
build template for tribe_hackathon_prizes_email
sebastiantf a2ae49c
management command for tribe_hackathon_prizes
sebastiantf 3241223
setup cron job
sebastiantf 67a4609
email intro util function
sebastiantf b67f24e
rewrite tribe_hackathon_prizes()
sebastiantf 688dad1
rewrite render_tribe_hackathon_prizes()
sebastiantf 80b733c
rewrite web preview function
sebastiantf ce6fb73
rewrite template()
sebastiantf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
we have a problem here, should use sponsor_profiles we not longer use Sponsors to control hackathons
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.
@octavioamu @PixelantDesign I have a PR up at #7589