diff --git a/retractions/management/commands/retrieve_mailgun_events.py b/retractions/management/commands/retrieve_mailgun_events.py index a99f8e4..0e33da8 100644 --- a/retractions/management/commands/retrieve_mailgun_events.py +++ b/retractions/management/commands/retrieve_mailgun_events.py @@ -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: diff --git a/retractions/management/commands/send_retraction_emails.py b/retractions/management/commands/send_retraction_emails.py index 354e04c..ef38cb4 100644 --- a/retractions/management/commands/send_retraction_emails.py +++ b/retractions/management/commands/send_retraction_emails.py @@ -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" ', + from_email='"The RetractoBot Team, University of Oxford" ', to=to_emails, ) msg.attach_alternative(body, "text/html") @@ -249,20 +249,22 @@ def _get_body_and_subject(self, pairs, recentest_citing_paper, author): body += "" body += "" # Collect information about whether the mail was useful. - body += """

We run the RetractoBot - research project, which aims to reduce the propagation of flawed - research in the biomedical literature by reducing citations of - retracted research papers.

+ body += """

The RetractoBot + 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.

Was this information useful?
Please click below to let us know whether you knew about the retraction. -
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.""" +
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 += """

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

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. 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 += """

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. 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.

""" return (subject, body) diff --git a/retractions/tests/commands/test_retrieve_mailgun_events.py b/retractions/tests/commands/test_retrieve_mailgun_events.py index 03f1257..745271f 100644 --- a/retractions/tests/commands/test_retrieve_mailgun_events.py +++ b/retractions/tests/commands/test_retrieve_mailgun_events.py @@ -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 @@ -51,7 +51,7 @@ def _inner_fake_get(url, auth): "headers": { "to": "Victor S. Tofu ", "message-id": message_id, - "from": '"Ben Goldacre, University of Oxford" ', + "from": '"Ben Goldacre, University of Oxford" ', "subject": """RetractoBot: You cited a retracted paper in your Frontiers in Tofu paper published in 2018""", }, diff --git a/retractions/tests/commands/test_send_retraction_emails.py b/retractions/tests/commands/test_send_retraction_emails.py index 17b933b..f0ae2d8 100644 --- a/retractions/tests/commands/test_send_retraction_emails.py +++ b/retractions/tests/commands/test_send_retraction_emails.py @@ -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" ', + '"The RetractoBot Team, University of Oxford" ', ) self.assertEqual(email.recentest_citing_paper_id, "500000") html = email.alternatives[0][0] @@ -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" ', + '"The RetractoBot Team, University of Oxford" ', ) self.assertEqual(email.recentest_citing_paper_id, "500010") html = email.alternatives[0][0] diff --git a/retractobot/settings.py b/retractobot/settings.py index ee7cc00..462d3de 100644 --- a/retractobot/settings.py +++ b/retractobot/settings.py @@ -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"