Remove trailing punctuation after URLs in EE plain-text emails

What does this MR do and why?

In three EE plain-text notification emails, a URL placeholder is followed directly by a period or an exclamation mark. Some email clients treat that trailing character as part of the URL, so clicking the link leads to a 404 instead of the intended page.

Affected templates, all under ee/app/views/notify/:

  • user_auto_banned_email.text.erb: two sentences end with %{url}.
  • group_secret_rotation_reminder_email.text.erb and project_secret_rotation_reminder_email.text.erb: share the string SecretRotation|You can update the secret at: %{target_url}!

Following Technical Writing review, each sentence is rephrased so the URL sits mid-sentence and is followed by a space, for example Go to %{target_url} to update the secret. The sentence keeps its closing period and the link stays clean. locale/gitlab.pot is updated for the three affected msgids.

The HTML versions of these emails use separate strings with link markup, so they are not affected by this bug.

This follows the same fix already applied to the CE token and SSH key emails in !254859 (merged).

References

Screenshots or screen recordings

Rendered plain-text excerpts. The domain is an example.

Before:

You can update the secret at: https://gitlab.example.com/groups/example/-/secrets#/DATABASE_PASSWORD/details!

After:

Go to https://gitlab.example.com/groups/example/-/secrets#/DATABASE_PASSWORD/details to update the secret.

How to set up and validate locally

Run the mailer specs, which include a shared example asserting the plain-text part contains the URL and that no punctuation character (., ,, ;, :, !, ?) directly follows it. Four URLs are covered: the banned users admin page, the reporting settings page (both also checked in the group-scoped variant), and the group and project secrets pages.

bundle exec rspec ee/spec/mailers/ee/emails/admin_notification_spec.rb ee/spec/mailers/notify_spec.rb

Locally, Ruby syntax was checked for both specs, the three templates were checked with an ERB compile check, and git diff --check was run. RSpec itself was not run locally; the MR pipeline runs it.

MR acceptance checklist

  • I have evaluated the impact of this change against the guidelines in the merge request acceptance checklist
  • I have self-reviewed this MR per code review guidelines
  • I have added or updated tests to cover the change
  • I have confirmed this change passes the CI/CD pipeline
Edited by Torben Buck

Merge request reports

Loading
Loading