self-hosted
self-hosted copied to clipboard
Inconsistent email subject formatting
Environment
self-hosted (https://develop.sentry.dev/self-hosted/)
Steps to Reproduce
- Navigate to
sentry.example.com/settings/account/emails/ - Click on
Resend verification
Likely the problem is this formatting string:
https://github.com/getsentry/sentry/blob/dc7f8f8fe8ef0b67db7550815cde9cf61204a009/src/sentry/users/models/user.py#L293
or this one:
https://github.com/getsentry/sentry/blob/dc7f8f8fe8ef0b67db7550815cde9cf61204a009/src/sentry/users/models/user.py#L318
After a simple search in the repo, many other email notifications face the same issue:
https://github.com/getsentry/sentry/blob/dc7f8f8fe8ef0b67db7550815cde9cf61204a009/src/sentry/auth/idpmigration.py#L89
https://github.com/getsentry/sentry/blob/dc7f8f8fe8ef0b67db7550815cde9cf61204a009/src/sentry/api/endpoints/project_transfer.py#L109
https://github.com/getsentry/sentry/blob/dc7f8f8fe8ef0b67db7550815cde9cf61204a009/src/sentry/api/endpoints/secret_scanning/github.py#L155
https://github.com/getsentry/sentry/blob/dc7f8f8fe8ef0b67db7550815cde9cf61204a009/src/sentry/api/endpoints/organization_details.py#L1168
Full search: https://github.com/search?q=repo%3Agetsentry%2Fsentry%20mail.subject-prefix&type=code
It's not a show-stopper, but would make the product more polished. I can start a PR if you want.
Expected Result
Subject: [Sentry] Confirm Email
Actual Result
Subject: [Sentry]Confirm Email
Product Area
Other
Link
No response
DSN
No response
Version
25.1.0
Assigning to @getsentry/support for routing ⏲️
You can submit a PR to the getsentry/sentry repo. Link this issue to your PR later.
Uhmm, I was just thinking... What happens if someone has the mail.subject-prefix set to an empty string ""?
What approach do you suggest to avoid having a leading space in the subject in that case? Should we add the space to the prefix itself?
How can I link it to this issue? Here it is: https://github.com/getsentry/sentry/pull/85540
Uhmm, I was just thinking... What happens if someone has the mail.subject-prefix set to an empty string ""?
What approach do you suggest to avoid having a leading space in the subject in that case? Should we add the space to the prefix itself?
@aldy505 should I add a trailing space to the prefix? This is the only simple solution I see for now.
Uhmm, I was just thinking... What happens if someone has the mail.subject-prefix set to an empty string ""? What approach do you suggest to avoid having a leading space in the subject in that case? Should we add the space to the prefix itself?
@aldy505 should I add a trailing space to the prefix? This is the only simple solution I see for now.
@leeoocca I think it would be better if you trim the value if exists and put a suffix space. Something like this:
subject="{}Confirm Email".format(options.get("mail.subject-prefix").strip() + " " if not options.get("mail.subject-prefix") else ""),
I think it would be better if you trim the value if exists and put a suffix space
I though something similar, but I'm afraid of all the boilerplate it adds every time you want to compose an email subject. Isn't there a better way to abstract it? Maybe an own function?
I think it would be better if you trim the value if exists and put a suffix space
I though something similar, but I'm afraid of all the boilerplate it adds every time you want to compose an email subject. Isn't there a better way to abstract it? Maybe an own function?
It should be up to you! See Sentry's philosophy here if you haven't read this (I'm not an employee and this is actually a good read): https://develop.sentry.dev/getting-started/philosophy/
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀