diff --git a/met-api/src/met_api/services/email_verification_service.py b/met-api/src/met_api/services/email_verification_service.py index 131a0353e..b14a9f22c 100644 --- a/met-api/src/met_api/services/email_verification_service.py +++ b/met-api/src/met_api/services/email_verification_service.py @@ -46,17 +46,20 @@ def create(cls, email_verification: EmailVerificationSchema, session=None) -> Em cls.validate_fields(email_verification) email_address: str = email_verification.get('email_address') survey = SurveyModel.get_open(email_verification.get('survey_id')) - engagement: EngagementModel = EngagementModel.find_by_id(survey.engagement_id) + engagement: EngagementModel = EngagementModel.find_by_id( + survey.engagement_id) if engagement.is_internal and not email_address.endswith(INTERNAL_EMAIL_DOMAIN): raise BusinessException( error='Not an internal email address.', status_code=HTTPStatus.INTERNAL_SERVER_ERROR) if email_address is not None: - participant = ParticipantService.get_or_create_by_email(email_address) + participant = ParticipantService.get_or_create_by_email( + email_address) email_verification['participant_id'] = participant.id - email_verification['created_by'] = email_verification.get('participant_id') + email_verification['created_by'] = email_verification.get( + 'participant_id') email_verification['verification_token'] = uuid.uuid4() EmailVerification.create(email_verification, session) @@ -105,9 +108,11 @@ def _send_verification_email(email_verification: dict) -> None: survey, email_verification.get('verification_token'), email_verification.get('type'), participant_id) try: # user hasn't been created yet.so create token using SA. - notification.send_email(subject=subject, email=email_to, html_body=body, args=args, template_id=template_id) + notification.send_email( + subject=subject, email=email_to, html_body=body, args=args, template_id=template_id) except Exception as exc: # noqa: B902 - current_app.logger.error('= verification_expiry_datetime: raise ValueError('Email verification is expired') diff --git a/met-api/templates/email_rejected_comment.html b/met-api/templates/email_rejected_comment.html index 954824a61..68fed9606 100644 --- a/met-api/templates/email_rejected_comment.html +++ b/met-api/templates/email_rejected_comment.html @@ -1,30 +1,32 @@

Thank you for taking the time to provide your feedback on {{ engagement_name }}.

-

We have reviewed your feedback and can't accept it for the following reason(s):


-

Your feedback contained:

+

We have reviewed your feedback and can't accept it for the following reason(s):



-

You can edit and re-submit your feedback here.

+

{{review_notes}}

+
+

You can edit and re-submit your feedback.

The comment period is open until {{ end_date }}. You must re-submit your feedback before the comment period closes.


+

Edit Feedback

+

Thank you,


The {{tenant_name}} Team

diff --git a/met-api/templates/email_verification.html b/met-api/templates/email_verification.html index a020c7882..7a82e4721 100644 --- a/met-api/templates/email_verification.html +++ b/met-api/templates/email_verification.html @@ -1,7 +1,12 @@ -

Share your feedback about {{ engagement_name }}.

-

Please click the link below to provide your feedback. This link will expire in 24 hours and is only valid once. If the link has expired, you can request request access again by visiting {{ engagement_name }}.

+

Thank you for sharing your feedback about {{engagement_name}}.


-

Click here to provide your feedback.

+

Please click the link below to provide your feedback.

+
+

Access will expire in 24 hours and is only valid once. If your access has expired, you can request access again at {{ engagement_url }}.

+
+

Provide Feedback

+
+

Written public feedback will be posted as soon as it is reviewed and approved (within 7 days). A report will be available after the public comment period is over, starting on {{ end_date }}.


Thank you,