From aa785abc114af61fb10972411e45201df6cebad5 Mon Sep 17 00:00:00 2001 From: alexandru-m-g Date: Thu, 31 Oct 2024 15:52:39 +0200 Subject: [PATCH 1/4] HDX-10285 dataset title in validatino email also changing token error message to remove mention of expiration. --- .../email/content/notification_platform/verify_email.html | 1 + .../ckanext/hdx_users/views/notification_platform.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/content/notification_platform/verify_email.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/content/notification_platform/verify_email.html index 7e77c2e5c8..a951a44ec3 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/content/notification_platform/verify_email.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/content/notification_platform/verify_email.html @@ -1,5 +1,6 @@

Dear HDX User,

+

You're subscribing to the {{ data.dataset_title }} dataset

Please verify your email by clicking the button below:

Verify email diff --git a/ckanext-hdx_users/ckanext/hdx_users/views/notification_platform.py b/ckanext-hdx_users/ckanext/hdx_users/views/notification_platform.py index 16a01c3f64..0e50235172 100644 --- a/ckanext-hdx_users/ckanext/hdx_users/views/notification_platform.py +++ b/ckanext-hdx_users/ckanext/hdx_users/views/notification_platform.py @@ -39,7 +39,7 @@ def subscribe_to_dataset() -> Response: try: token_obj = notification_platform_logic.verify_email_validation_token(token) except Exception as e: - _h.flash_error('Your token is invalid or has expired. Please try to subscribe again.') + _h.flash_error('Your token is invalid. Your email address might have already been validated.') EmailValidationAnalyticsSender('notification platform', False, '').send_to_queue() return tk.redirect_to(dataset_list_url) @@ -91,6 +91,7 @@ def subscription_confirmation() -> Response: hdx_validate_email(email) token_obj = notification_platform_logic.get_or_generate_email_validation_token(email, dataset_id) + dataset_dict = tk.get_action('package_show')({}, {'id': dataset_id}) subject = u'Please verify your email address' verify_email_link = _h.url_for( @@ -98,7 +99,9 @@ def subscription_confirmation() -> Response: token=token_obj.token, qualified=True ) email_data = { - 'verify_email_link': verify_email_link + 'verify_email_link': verify_email_link, + 'dataset_title': dataset_dict.get('title'), + 'dataset_id': dataset_id } hdx_mailer.mail_recipient([{'email': email}], subject, email_data, footer=None, snippet='email/content/notification_platform/verify_email.html') From b4089a270315884ece09db4c7233a8df328af048 Mon Sep 17 00:00:00 2001 From: Catalin Date: Thu, 31 Oct 2024 17:40:11 +0200 Subject: [PATCH 2/4] HDX-10301 decrease font-sizes and reduce spacing --- .../hdx_theme/templates/email/email.html | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/email.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/email.html index ce0a723c10..b7ce3e18a9 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/email.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/email.html @@ -24,8 +24,8 @@ } .hdx-email .hdx-content p { - font-size: 20px; - line-height: 180%; + font-size: 16px; + line-height: 140%; margin-top: 0; margin-bottom: 15px; } @@ -35,8 +35,8 @@ } .hdx-email .hdx-content li { - font-size: 20px; - line-height: 150%; + font-size: 16px; + line-height: 130%; } .hdx-email .hdx-content a { @@ -50,9 +50,9 @@ background-color: #007CE1; padding: 19px 32px; font-weight: 600; - margin: 32px 0; - font-size: 16px; - line-height: 125%; + margin: 16px 0; + font-size: 14px; + line-height: 130%; text-decoration: none; } @@ -64,11 +64,11 @@ } .hdx-email .hdx-content .quote p { margin-bottom: 0; - line-height: 150%; + line-height: 130%; } .hdx-email .hdx-logo { - padding: 35px; + padding: 25px; background-color: #F2F2F2; } @@ -77,7 +77,7 @@ } .hdx-email .hdx-logo img { - width: 110px; + width: 90px; height: auto; display: block; } @@ -107,8 +107,8 @@ } .hdx-email .hdx-footer p { - font-size: 16px; - line-height: 150%; + font-size: 14px; + line-height: 130%; margin-top: 0; margin-bottom: 0; } @@ -132,7 +132,7 @@ } .hdx-email .hdx-logo a { - width: 110px !important; + width: 90px !important; overflow: hidden !important; } } From f9b2d40d5b9c90dafc9fdfe87590e1fbdfeba071 Mon Sep 17 00:00:00 2001 From: Catalin Date: Thu, 31 Oct 2024 17:44:31 +0200 Subject: [PATCH 3/4] HDX-10285 add missing period to the end of the sentence --- .../email/content/notification_platform/verify_email.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/content/notification_platform/verify_email.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/content/notification_platform/verify_email.html index a951a44ec3..9e9c189580 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/content/notification_platform/verify_email.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/email/content/notification_platform/verify_email.html @@ -1,6 +1,6 @@

Dear HDX User,

-

You're subscribing to the {{ data.dataset_title }} dataset

+

You're subscribing to the {{ data.dataset_title }} dataset.

Please verify your email by clicking the button below:

Verify email From 0ee7088d3451fb1bba6f77672b3c753e9d0608a4 Mon Sep 17 00:00:00 2001 From: Dan Mihaila Date: Mon, 4 Nov 2024 15:17:22 +0200 Subject: [PATCH 4/4] Update version.py --- ckanext-hdx_theme/ckanext/hdx_theme/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/version.py b/ckanext-hdx_theme/ckanext/hdx_theme/version.py index a5c72b9bc0..6ad98b7ced 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/version.py +++ b/ckanext-hdx_theme/ckanext/hdx_theme/version.py @@ -1 +1 @@ -hdx_version = 'v1.84.2' +hdx_version = 'v1.84.3'