-
-
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
GDPR: Management command to send email to all gitcoin users #1252
GDPR: Management command to send email to all gitcoin users #1252
Conversation
@@ -0,0 +1,81 @@ | |||
''' | |||
Copyright (C) 2017 Gitcoin Core |
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.
W291 trailing whitespace
from marketing.mails import gdpr_update | ||
from marketing.models import EmailSubscriber | ||
|
||
warnings.filterwarnings("ignore", category=DeprecationWarning) |
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.
W291 trailing whitespace
9fb6e7c
to
5a1f63a
Compare
Codecov Report
@@ Coverage Diff @@
## master #1252 +/- ##
==========================================
- Coverage 31.57% 31.37% -0.21%
==========================================
Files 118 119 +1
Lines 8186 8239 +53
Branches 1065 1072 +7
==========================================
Hits 2585 2585
- Misses 5491 5544 +53
Partials 110 110
Continue to review full report at Codecov.
|
<h1>{% trans "Gitcoin: Updated Terms & Policies" %}</h1> | ||
<div style="text-align: left! important"> | ||
<p> | ||
{% trans "Hello" %} {{subscriber}}, |
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.
Just a note... we should get into the habit of using {{ var }}
formatted variables in django templates.
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.
I know. But since I saw this is the format followed most placed, so I thought of sticking with it to maintain uniformity. I literally changed from {{ var }}
to {{var}}
😋
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.
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.
😂
counter = 0 | ||
for to_email in email_list: | ||
counter += 1 | ||
print("-sending {} / {}".format(counter, to_email)) |
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 could remove .format
here with: print('-sending, counter, '/', to_email)
or print(f'-sending {counter} / {to_email}')
queryset = queryset.order_by('email') | ||
email_list = set(queryset.values_list('email', flat=True)) | ||
|
||
print("got {} emails".format(len(email_list))) |
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.
Could eliminate .format here: print('got', len(email_list), 'emails')
or `print(f'got {len(email_list)} emails')
) | ||
|
||
def handle(self, *args, **options): | ||
|
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.
No new line between method and beginning logic/docstrings.
{% 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>{% blocktrans %}<a href="{{terms_of_use_link}}">Our updated Terms of Use </a>{% endblocktrans %}</li> |
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.
To avoid issues with autogeneration of translations, I've been trying to avoid wrapping dynamic vars in blocktrans
. We could update this to:
<li><a href="{{ terms_of_use_link }}">{% trans "Our updated Terms of Use" %} </a></li>
app/retail/emails.py
Outdated
@@ -297,6 +297,22 @@ def render_bounty_startwork_expired(to_email, bounty, interest, time_delta_days) | |||
return response_html, response_txt | |||
|
|||
|
|||
def render_gdpr_update(to_email): | |||
|
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.
No new line here
app/retail/emails.py
Outdated
|
||
params = { | ||
'subscriber': get_or_save_email_subscriber(to_email, 'internal'), | ||
'terms_of_use_link': '', |
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.
Should these params have value to reverses of their relevant urls?
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.
Yes. I was about to comment. But all the links are still not active in the master branch. Hence I will add them once the other PRs get merged.
5a1f63a
to
6a296f8
Compare
6a296f8
to
82dbf51
Compare
app/retail/emails.py
Outdated
def render_gdpr_update(to_email): | ||
params = { | ||
'subscriber': get_or_save_email_subscriber(to_email, 'internal'), | ||
'terms_of_use_link': '', #TODO |
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.
E261 at least two spaces before inline comment
E262 inline comment should start with '# '
app/retail/emails.py
Outdated
params = { | ||
'subscriber': get_or_save_email_subscriber(to_email, 'internal'), | ||
'terms_of_use_link': '', #TODO | ||
'privacy_policy_link': '', #TODO |
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.
E261 at least two spaces before inline comment
E262 inline comment should start with '# '
app/retail/emails.py
Outdated
'subscriber': get_or_save_email_subscriber(to_email, 'internal'), | ||
'terms_of_use_link': '', #TODO | ||
'privacy_policy_link': '', #TODO | ||
'cookie_policy_link': '', #TODO |
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.
E261 at least two spaces before inline comment
E262 inline comment should start with '# '
0260d0b
to
86b9700
Compare
note: we should not send this email to users who have previously opted out of newsletters. that should mean that if their |
i believe we need to send this today |
app/retail/emails.py
Outdated
def render_gdpr_update(to_email): | ||
params = { | ||
'subscriber': get_or_save_email_subscriber(to_email, 'internal'), | ||
'terms_of_use_link': '', # TODO |
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.
these need to be filled in
probably https://gitcoin.co/legal/xxxx
b26110d
to
145d2c4
Compare
app/retail/emails.py
Outdated
@@ -23,6 +23,7 @@ | |||
from django.contrib.admin.views.decorators import staff_member_required | |||
from django.http import HttpResponse | |||
from django.shortcuts import redirect | |||
from django.urls import reverse |
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.
F401 'django.urls.reverse' imported but unused
feeffaf
to
7ea2e8f
Compare
Description
Management command so that we can send the GDPR policy update email to all the subscribed users of gitcoin
Checklist
Affected core subsystem(s)
management
Testing
./manage.py gdpr_update_email --live
Screenshot of HTML:
Refers/Fixes
FIxes #1242