diff --git a/SPRINTLOG.md b/SPRINTLOG.md index ee717956f..8001f5ca5 100644 --- a/SPRINTLOG.md +++ b/SPRINTLOG.md @@ -313,3 +313,4 @@ _Nothing merged in CLI during this sprint_ - Project title displayed along with the internal project ID email sent when a project is released ([#1475](https://github.com/ScilifelabDataCentre/dds_web/pull/1475)) - Use full DDS name in MOTD email subject ([#1477](https://github.com/ScilifelabDataCentre/dds_web/pull/1477)) - Add flag --verify-checksum to the comand in email template ([#1478])(https://github.com/ScilifelabDataCentre/dds_web/pull/1478) +- Improved email layout; Highlighted information and commands when project is released ([#1479])(https://github.com/ScilifelabDataCentre/dds_web/pull/1479) diff --git a/dds_web/templates/mail/mail_base.html b/dds_web/templates/mail/mail_base.html index d0dd52e7f..a9531bcb7 100644 --- a/dds_web/templates/mail/mail_base.html +++ b/dds_web/templates/mail/mail_base.html @@ -1,6 +1,23 @@ - + + @@ -122,6 +139,10 @@ border-color: #a00202 !important; } } + code { + background-color: pink; + color: black; +} diff --git a/dds_web/templates/mail/project_release.html b/dds_web/templates/mail/project_release.html index 4183de5fa..06d536664 100644 --- a/dds_web/templates/mail/project_release.html +++ b/dds_web/templates/mail/project_release.html @@ -18,22 +18,29 @@

+ You were added to this project {% if unit_email %} on behalf of {% else %} by {% endif %} {{displayed_sender}}. +

+

+ To list the files in this project, run:
+ dds ls -p {{project_id}}

+
+

+ To download all the files in this project to your current directory, run:
+ dds data get -p {{project_id}} -a --verify-checksum

+

+ For more information (including an installation guide), see the DDS CLI documentation here: scilifelabdatacentre.github.io/dds_cli.

+

+ {% if unit_email %} - You were added to this project on behalf of {{displayed_sender}} ({{unit_email}}). + If you experience issues, please contact the SciLifeLab unit {{displayed_sender}} at {{unit_email}}. {% else %} - You were added to this project by {{displayed_sender}}. + If you experience issues, please contact the SciLifeLab unit {{displayed_sender}}. {% endif %}

-

- The DDS CLI command dds ls -p {{project_id}} can be used to list the files in this project.

-

- The DDS CLI command dds data get -p {{project_id}} -a --verify-checksum can be used to download all the files in this project to your current directory.

-

- Your access to this project will expire on {{deadline}}

+

+ Your access to this project will expire on:
{{deadline}}

- What is the DDS? The DDS is a system for SciLifeLab infrastructures to deliver data to researchers in a fast, secure and simple - way.

- + What is the DDS? The DDS is a system for SciLifeLab infrastructures to deliver data to researchers in a fast, secure and simple way.

diff --git a/dds_web/templates/mail/project_release.txt b/dds_web/templates/mail/project_release.txt index 162f0a803..9b6dd9220 100644 --- a/dds_web/templates/mail/project_release.txt +++ b/dds_web/templates/mail/project_release.txt @@ -2,15 +2,21 @@ The following project is now available for your access in the SciLifeLab Data De - Project Title: {{project_title}} - DDS project ID: {{project_id}} -{% if unit_email %} -You were added to this project on behalf of {{displayed_sender}} ({{unit_email}}). -{% else %} -You were added to this project by {{displayed_sender}}. -{% endif %} +You were added to this project {% if unit_email %} on behalf of {% else %} by {% endif %} {{displayed_sender}}. -The DDS CLI command 'dds ls -p {{project_id}}' can be used to list the files in this project. +To list the files in this project, run: + dds ls -p {{project_id}} -The DDS CLI command 'dds data get -p {{project_id}} -a --verify-checksum' can be used to download all the files in this project to your current directory. +To download all the files in this project to your current directory, run: + dds data get -p {{project_id}} -a --verify-checksum. + +For more information (including an installation guide), see the DDS CLI documentation here: https://scilifelabdatacentre.github.io/dds_cli/ + +{% if unit_email %} +If you experience issues, please contact the SciLifeLab unit {{displayed_sender}} at {{unit_email}}. +{% else %} +If you experience issues, please contact the SciLifeLab unit {{displayed_sender}}. +{% endif %} Your access to this project will expire on {{deadline}} diff --git a/tests/api/test_project.py b/tests/api/test_project.py index 867da5ef3..7ac6ce020 100644 --- a/tests/api/test_project.py +++ b/tests/api/test_project.py @@ -1424,10 +1424,23 @@ def test_email_project_release(module_client, boto3_session): ## check plain text message assert f"- Project Title: {project_title}" in body assert f"- DDS project ID: {public_project_id}" in body + assert f"dds ls -p {public_project_id}" in body + assert f"dds data get -p {public_project_id} -a --verify-checksum" in body + assert "If you experience issues, please contact the SciLifeLab unit" in body + assert ( + "What is the DDS? The DDS is a system for SciLifeLab infrastructures to deliver data to researchers in a fast, secure and simple way" + in body + ) ## check html - assert f"
  • Project Title: {project_title}
  • " in html assert f"
  • DDS project ID: {public_project_id}
  • " in html + assert f"dds ls -p {public_project_id}" in html + assert f"dds data get -p {public_project_id} -a --verify-checksum" in html + assert "If you experience issues, please contact the SciLifeLab unit" in html + assert ( + "What is the DDS? The DDS is a system for SciLifeLab infrastructures to deliver data to researchers in a fast, secure and simple way." + in html + ) assert response.status_code == http.HTTPStatus.OK