-
-
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 Grants txn Failed Email #6791
Changes from all commits
d7c4554
8611632
ec5a0e5
9486ad9
2f60d92
902f548
e444c77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
''' | ||
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 grants.models import Contribution | ||
from marketing.mails import grant_txn_failed | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'sends emails for grant contributors whose contribution txns have failed' | ||
|
||
def handle(self, *args, **options): | ||
if settings.DEBUG: | ||
print("not active in non prod environments") | ||
return | ||
|
||
failed_contribs = Contribution.objects.exclude(validator_passed=True) | ||
|
||
for failed_contrib in failed_contribs: | ||
grant_txn_failed(failed_contrib.subscription.contributor_profile, failed_contrib.subscription.grant, failed_contrib.tx_id) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{% 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> | ||
.etherscan-link { | ||
display: inline-block; | ||
font-family: 'Muli', sans-serif; | ||
color: #3E00FF; | ||
} | ||
|
||
.grant-txn-msg, .grant-txn-id { | ||
margin: 0 auto; | ||
} | ||
|
||
.grant-txn-id a { | ||
overflow-wrap: break-word; | ||
} | ||
</style> | ||
|
||
<h1>Grants transaction failed, try again?</h1> | ||
|
||
<div class="grant-txn-msg"> | ||
<p> | ||
Your contribution to <b>{{ grant_title }}</b> failed due to a technical issue. | ||
</p> | ||
</div> | ||
|
||
<div class="grant-txn-id"> | ||
<p> | ||
Transaction ID: <br> | ||
<a href="{{ tx_url }}">{{ tx_id }}</a> | ||
</p> | ||
</div> | ||
|
||
<div style="margin-bottom: 3em; margin-top: 3em;"> | ||
<a class="button" href="{{ bulk_add_url }}">{% trans "Resubmit Transaction" %}</a> | ||
<br> | ||
<a class="etherscan-link" href="{{ tx_url }}">View on Etherscan</a> | ||
</div> | ||
|
||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Grants transaction failed, try again? | ||
|
||
Your contribution to {{ grant_title }} failed due to a technical issue. | ||
|
||
Transaction ID: {{ tx_id }} | ||
|
||
View on Etherscan |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -323,6 +323,18 @@ | |
} | ||
} | ||
|
||
@media (min-width: 768px) { | ||
.grant-txn-msg { | ||
width: 70%; | ||
} | ||
} | ||
|
||
@media (min-width: 1200px) { | ||
.grant-txn-msg { | ||
width: 60%; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ could we move this to the needed email files! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @thelostone-mc Gmail seems to have an issue while using media queries in emails. It only considers the first set of media queries it sees and ignores media queries seen anywhere else afterwards. I found this behaviour while working on the daily email redesign and also found on the Internet that others have experienced this behaviour too. The workaround is to include all the media queries in the first place (first <style> tag) and that would be the one in template.html. This is why the media queries and the corresponding styles are all placed in template.html itself. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay that makes sense ! If we are doing this, we should collect it from all emails and add that in Could we move these though into the grant specific mail ?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay that makes sense ! If we are doing this, we should collect it from all emails and add that in Could we move these though into the grant specific mail ?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@thelostone-mc Done in e444c77 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I do doubt that the media query styles present inside specific email templates are actually being rendered correctly by Gmail. That may have to be tested and taken care of. But the commits in this PR wont affect the other emails. |
||
|
||
/* Bootstrap styles used for activities -- START */ | ||
|
||
*, | ||
|
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.
Note for the future: we'll have to update this to use other block explorers once we support other chains