- Issue created by @super_romeo
- Status changed to Postponed: needs info
9 months ago 5:27pm 11 October 2023 - π¬π§United Kingdom AdamPS
You raised π Override settings may be wrong after upgrade from 1.2.x Fixed which was very similar. Then your issue title got changed. Is this definitely different from the other issue? Do you see the problem on a clean install of 1.3 (without upgrade from 1.2).
Anyway I commented on the other issue, and I'll comment the same again:
It works for me.
UserEmailBuilder::build
passes the callbackuser_mail_tokens
. - πΊπ¦Ukraine bohart Lutsk, Ukraine
As we use Drupal Symfony Mailer on our projects, I have tested the topic also (as I need to be sure user emails work well).
Everything works well / as expected. So, I decided to write down this comment here as well. Hopefully, this comment (and testing) will be helpful for further decisions on this issue for the maintainer.@super_romeo, if the issue still exists, please provide the exact step-by-step instructions (from vanilla Drupal install) for reproducing the issue and re-open this task.
If it still occurs, this will help to find and fix the source of the issue.
This will significantly help everyone to be sure that user emails work correctly! As it's an important part of most projects.@AdamPS, as for now, I assume this issue can be marked as closed (without a fix required).
Thanks! - π¬π§United Kingdom AdamPS
Great thanks @bohart
I assume this issue can be marked as closed (without a fix required).
Normally I leave it as postponed for a month or two to allow the OP to add more info. I agree after that it can be closed "cannot reproduce"
- πΊπ¦Ukraine super_romeo Kiev
Thank you for your support!
But issue still stands.Steps:
Uninstall module.
Install version 1.4.0-beta2.
Setup SMTP transport.
On Overridetab opposite the Users click Enable and import.
Send email. Tokens are replaced OK.Create text formatter with filter Replace tokens with the Replace empty values option checked.
On Policy tab on User (Password recovery) click Edit.
Change format to just created formatter and save.
Send email. Use tokens are replaced with "". - Status changed to Active
8 months ago 1:30pm 23 October 2023 - π¬π§United Kingdom AdamPS
Aha thanks @super_romeo for a clear report - now I understand.
The text formatter you have created is removing the tokensπ. I suggest you change the text format. I can't see any way to change this module that would help you.
- πΊπ¦Ukraine super_romeo Kiev
I guess user-context should be passed to text format filters.
But I don't know how...Since it's related not only to password reset mail but all User mails, this issue is going to be quite popular soon :(
- π¬π§United Kingdom AdamPS
Since it's related not only to password reset mail but all User mails, this issue is going to be quite popular soon :(
No I think the problem is the text format on your siteπ.
Also got the same problem. The custom text format i use, is not able to render the [user:...] tokens. I need the custom format, because i have to render some html tags. Im not sure, but why is the "plain_text" format able to render the user tokens, and some custom format not? Do i miss some configurations?
I found now a solution:
- Remove global token replacement from your custom formatter
- Uninstall the symfony mailer module
- Install the symfony mailer module again (I installed 1.4.0)
- Enable & Import User & User Registration Password Overrides at /admin/config/system/mailer/override
- Go to the /admin/config/system/mailer and edit the html value of one of the settings
- Change the format to your custom formatter & save.
Hope, this will help.
- π¬π§United Kingdom AdamPS
This module renders user tokens correctly.
The text format runs first, and it can't render user tokens. If the text format has "Replace empty values" then the tokens are lost, and this module cannot render them.
- π¬π§United Kingdom AdamPS
I don't see the "replace tokens" filter - perhaps it comes from a contrib module?? Anyone that's what causes the problem.
- πΊπ¦Ukraine super_romeo Kiev
Filter named
Replaces global and entity tokens with their values
fromtoken_filter
module. - Status changed to Closed: works as designed
8 months ago 5:35pm 25 October 2023 - π¬π§United Kingdom AdamPS
Thanks for explaining. Closing because I see no bug. The site has a text format that removes the tokens and that's why they are missing.
- πΊπ¦Ukraine Taran2L Lviv
This module renders user tokens correctly.
The text format runs first, and it can't render user tokens. If the text format has "Replace empty values" then the tokens are lost, and this module cannot render them.
Yes, tokens do work, but this is exactly the problem. Symfony mailer should finishing building raw email and only then use a filter, like a last step in the pipeline
For example, filtering HTML does break some tokens in some situations. Should we create a new issue for that?