Skip to content

Commit

Permalink
Merge pull request #5 from ebmdatalab/update-transparency
Browse files Browse the repository at this point in the history
Update transparency
  • Loading branch information
ccunningham101 authored Jan 8, 2024
2 parents 88e40b5 + 8c3e767 commit ff14c6b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 24 deletions.
2 changes: 1 addition & 1 deletion retractions/management/commands/retrieve_mailgun_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def handle(self, *args, **options):
MAILGUN_API_KEY = setup.get_env_setting("RETR_MAILGUN_API_KEY")

# Get all events available
url = "https://api.mailgun.net/v3/retracted.net/events"
url = "https://api.eu.mailgun.net/v3/retracted.net/events"

# Loop through pages of events
while True:
Expand Down
44 changes: 25 additions & 19 deletions retractions/management/commands/send_retraction_emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def _generate_mail(self, pairs, author, to_emails):
msg = OurEmail(
subject=subject,
body=body_plaintext,
from_email='"The RetractoBot Team, University of Oxford" <ben@retracted.net>',
from_email='"The RetractoBot Team, University of Oxford" <team@retracted.net>',
to=to_emails,
)
msg.attach_alternative(body, "text/html")
Expand Down Expand Up @@ -249,20 +249,22 @@ def _get_body_and_subject(self, pairs, recentest_citing_paper, author):
body += "</tr>"
body += "</table>"
# Collect information about whether the mail was useful.
body += """<p>We run the <a href="https://retracted.net/">RetractoBot</a>
research project, which aims to reduce the propagation of flawed
research in the biomedical literature by reducing citations of
retracted research papers.</p>
body += """<p>The <a href="https://retracted.net/">RetractoBot</a>
research project is a randomised controlled trial (RCT) which
aims to see whether sending emails to authors who cited retracted
biomedical research papers impacts future citations of retracted
papers.</p>
<p><strong>Was this information useful?</strong><br/>
Please click below to let us know whether you knew about the
retraction.
<br>Your voluntary click, below, is taken as consent for your anonymous
response to be included in our analysis. If you have any other
comments, please reply to this email; your voluntary reply is taken
as consent for your comments to be used anonymously in our
qualitative analysis of the project unless otherwise noted."""
<br>Your voluntary click, below, is taken as consent for your
response to be included in our aggregated analysis. If you have any
other comments, please reply to this email; your voluntary reply is
taken as consent for us to include these comments in further
qualitative analysis for the project, with identifiable information
removed, unless otherwise noted in your response."""

body += """</p>"""
if total_papers > 1:
Expand Down Expand Up @@ -301,15 +303,19 @@ def _get_body_and_subject(self, pairs, recentest_citing_paper, author):

body += """<hr>"""

body += """<p><small>In accordance with the European Union General Data
Protection Regulation 2016 we would like to inform you of the following
information. We are using publicly accessible bibliographic information
from the PubMed and Scopus databases. We are processing only your name
and email address associated with your Scopus Author ID, which we
obtained from Scopus only to send you this message. <em>If you would
like to stop receiving emails from RetractoBot at this email address,
choose the 'unsubscribe' link below. If you would like to correct your
data on PubMed or Scopus, please contact those organisations
body += """<p><small>In accordance with the General Data
Protection Regulation (GDPR) we would like to inform you of the
following information. We are using publicly accessible bibliographic
information from the PubMed and Scopus databases. We are processing
only your name and email address associated with your Scopus Author ID,
which we obtained from Scopus only to send you this message. The data
is processed by Mailgun to send you this email and DigitalOcean to
store our dataset, but control of the data is retained by our project
team members. Your name and email address will be deleted from our
dataset after project completion. <em>If you would like to stop
receiving emails from RetractoBot at this email address, choose the
'unsubscribe' link below. If you would like to correct your data on
PubMed or Scopus, please contact those organisations
directly.</em></small></p>"""

return (subject, body)
Expand Down
4 changes: 2 additions & 2 deletions retractions/tests/commands/test_retrieve_mailgun_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def fake_get(message_id, test_case):
def _inner_fake_get(url, auth):
"""Overrides requests.get to pretends to be the MailGun API in a limited
way"""
base_url = "https://api.mailgun.net/v3/retracted.net/events"
base_url = "https://api.eu.mailgun.net/v3/retracted.net/events"
second_url = base_url + "/2"
third_url = base_url + "/3"
last_url = second_url
Expand All @@ -51,7 +51,7 @@ def _inner_fake_get(url, auth):
"headers": {
"to": "Victor S. Tofu <tofu@beans.com>",
"message-id": message_id,
"from": '"Ben Goldacre, University of Oxford" <ben@retracted.net>',
"from": '"Ben Goldacre, University of Oxford" <team@retracted.net>',
"subject": """RetractoBot: You cited a retracted paper in your
Frontiers in Tofu paper published in 2018""",
},
Expand Down
4 changes: 2 additions & 2 deletions retractions/tests/commands/test_send_retraction_emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_live_run_email_with_standard_citation(self):
self.assertEqual(email.track_clicks, True)
self.assertEqual(
email.from_email,
'"The RetractoBot Team, University of Oxford" <ben@retracted.net>',
'"The RetractoBot Team, University of Oxford" <team@retracted.net>',
)
self.assertEqual(email.recentest_citing_paper_id, "500000")
html = email.alternatives[0][0]
Expand Down Expand Up @@ -93,7 +93,7 @@ def test_live_run_email_with_standard_citation(self):
self.assertEqual(email.track_clicks, True)
self.assertEqual(
email.from_email,
'"The RetractoBot Team, University of Oxford" <ben@retracted.net>',
'"The RetractoBot Team, University of Oxford" <team@retracted.net>',
)
self.assertEqual(email.recentest_citing_paper_id, "500010")
html = email.alternatives[0][0]
Expand Down
1 change: 1 addition & 0 deletions retractobot/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
# Email config
ANYMAIL = {
"MAILGUN_API_KEY": env.str("RETR_MAILGUN_API_KEY"),
"MAILGUN_API_URL": "https://api.eu.mailgun.net/v3",
"MAILGUN_SENDER_DOMAIN": "retracted.net",
}
EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend"
Expand Down

0 comments on commit ff14c6b

Please sign in to comment.