-
-
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.
GDPR: Management command to send email to all gitcoin users
- Loading branch information
Showing
5 changed files
with
187 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
''' | ||
Copyright (C) 2017 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 time | ||
import warnings | ||
|
||
from django.core.management.base import BaseCommand | ||
|
||
from marketing.mails import gdpr_update | ||
from marketing.models import EmailSubscriber | ||
|
||
warnings.filterwarnings("ignore", category=DeprecationWarning) | ||
|
||
|
||
class Command(BaseCommand): | ||
|
||
help = 'the gdpr policy update email' | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument( | ||
'-live', '--live', | ||
action='store_true', | ||
dest='live', | ||
default=False, | ||
help='Actually Send the emails' | ||
) | ||
parser.add_argument( | ||
'--exclude_startswith', | ||
dest='exclude_startswith', | ||
type=str, | ||
default=None, | ||
help="exclude_startswith (optional)", | ||
) | ||
parser.add_argument( | ||
'--filter_startswith', | ||
dest='filter_startswith', | ||
type=str, | ||
default=None, | ||
help="filter_startswith (optional)", | ||
) | ||
|
||
def handle(self, *args, **options): | ||
exclude_startswith = options['exclude_startswith'] | ||
filter_startswith = options['filter_startswith'] | ||
|
||
queryset = EmailSubscriber.objects.filter(newsletter=True) | ||
if exclude_startswith: | ||
queryset = queryset.exclude(email__startswith=exclude_startswith) | ||
if filter_startswith: | ||
queryset = queryset.filter(email__startswith=filter_startswith) | ||
queryset = queryset.order_by('email') | ||
email_list = set(queryset.values_list('email', flat=True)) | ||
|
||
print(f'got {len(email_list)} emails') | ||
|
||
counter = 0 | ||
for to_email in email_list: | ||
counter += 1 | ||
print(f'-sending {counter} / {to_email}') | ||
if options['live']: | ||
try: | ||
gdpr_update([to_email]) | ||
time.sleep(1) | ||
except Exception as e: | ||
print(e) | ||
time.sleep(5) |
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,54 @@ | ||
{% extends 'emails/template.html' %} | ||
{% comment %} | ||
Copyright (C) 2017 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 %} | ||
{% load static %} | ||
|
||
{% block content %} | ||
|
||
<h1>{% trans "Gitcoin: Updated Terms & Policies" %}</h1> | ||
<div style="text-align: left! important"> | ||
<p> | ||
{% trans "Hello" %} {{ subscriber }}, | ||
</p> | ||
<p> | ||
{% trans "As a Web 3.0 company, we think carefully about user data and privacy and how the internet is evolving. We hope Web 3.0 will bring more control of data to users. With this ethos, we are always careful about how we use your information. " %} | ||
</p> | ||
<p> | ||
{% trans "We recently reviewed our Privacy Policy to comply with requirements of General Data Protection Regulation (GDPR), improving our Terms of Use, Privacy Policy and Cookie Policy. These changes will go into effect on May 25, 2018, and your continued use of the Gitcoin after May 25, 2018 will be subject to our updated Terms of Use and Privacy Policy. " %} | ||
</p> | ||
<p> | ||
{% trans "As always, the entire Gitcoin team works every day to make Gitcoin a safe and trustworthy place to grow open source. We invite you to learn more about our outlined updates to our Policies and Terms of Use: " %} | ||
</p> | ||
<ul> | ||
<li><a href="{{ terms_of_use_link }}">{% trans "Our updated Terms of Use " %}</a></li> | ||
<li><a href="{{ privacy_policy_link }}">{% trans "Our updated Privacy Policy " %}</a></li> | ||
<li><a href="{{ cookie_policy_link }}">{% trans "Our updated Cookie Policy " %}</a></li> | ||
</ul> | ||
|
||
<p> | ||
{% trans "We’ll continue to keep you updated on our data privacy policies on the path towards a more open, transparent web. Thanks for using Gitcoin, and please let us know if you have any questions or feedback. " %} | ||
</p> | ||
<p> | ||
{% blocktrans %} | ||
Warmly, <br> | ||
Gitcoin Core | ||
{% endblocktrans %} | ||
</p> | ||
</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,20 @@ | ||
Hello {{ subscriber }}, | ||
|
||
As a Web 3.0 company, we think carefully about user data and privacy and how the internet is evolving. We hope Web 3.0 will bring more control of data to users. With this ethos, we are always careful about how we use your information. | ||
|
||
We recently reviewed our Privacy Policy to comply with requirements of General Data Protection Regulation (GDPR), improving our Terms of Use, Privacy Policy and Cookie Policy. These changes will go into effect on May 25, 2018, and your continued use of the Gitcoin after May 25, 2018 will be subject to our updated Terms of Use and Privacy Policy. | ||
|
||
As always, the entire Gitcoin team works every day to make Gitcoin a safe and trustworthy place to grow open source. We invite you to learn more about our outlined updates to our Policies and Terms of Use: | ||
|
||
1) Our updated Terms of Use [1] | ||
2) Our updated Privacy Policy [2] | ||
3) Our updated Cookie Policy [3] | ||
|
||
We’ll continue to keep you updated on our data privacy policies on the path towards a more open, transparent web. Thanks for using Gitcoin, and please let us know if you have any questions or feedback. | ||
|
||
[1] {{ terms_of_use_link }} | ||
[2] {{ privacy_policy_link }} | ||
[3] {{ cookie_policy_link }} | ||
|
||
Warmly, | ||
Gitcoin Core |