Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System message not working or changes not applied #3673

Closed
krizajb opened this issue Jan 20, 2019 · 7 comments

Comments

@krizajb
Copy link

commented Jan 20, 2019

Description

The user password reset mail is acting weird. When resetting the user password the mail I receive has forgot_password_subject subject and forgot_password_body content. I tried checking the source code but after few hours gave up.
The systemmessages database table is empty. The System messages are correctly displayed in the admin control panel. The reset user password functionality works normal while being accessed via the admin page.
I've also discovered that changing the System message via admin control panel doesn't work.

Site language is sl-SI (Slovenian). Using sendgrid mailer.
image

Update:
I think I found the problem, still no clue how to solve it. If I set the site language to anything but en-US the system messages don't work. If i change it to en-US, the changes made to the system messages aren't applied.

Steps to reproduce

  1. Configure mailer
  2. Reset user password via front end
  3. Receive reset mail with forgot_password_subject subject and forgot_password_body mail content

Steps to reproduce (Update)

  1. Configure mailer
  2. Change 'When someone forgets their password:'
  3. systemmessages database table is successfully altered
  4. Change is visible in the control panel
  5. Reset user password via front end
  6. Receive the default reset password mail
@krizajb krizajb changed the title User reset password System message not working or changes not applied Jan 21, 2019
@brandonkelly

This comment has been minimized.

Copy link
Member

commented Jan 21, 2019

What version of Craft are you using?

Does the user account you’re testing have access to the Control Panel?

If so, what is their Preferred Language set to?

What is the language of the site?

In the systemmessages database table, which language(s) are stored in there?

@krizajb

This comment has been minimized.

Copy link
Author

commented Jan 21, 2019

Craft edition & version: Craft Pro 3.0.34

The user account is also an admin account. The language set on the admin account is English. So for the first case the site language was set to sl-SI (Slovenian) which produces the forgot_password_subject subject and forgot_password_body mail content. For the second case the site language is set to en-US (American English).

The systemmessages database table contains only en-US entries.

When trying to reset non admin user password the correct system message is applied!

@brandonkelly

This comment has been minimized.

Copy link
Member

commented Jan 21, 2019

When Craft is sending a system message to a user, if the user has a preferred language selected, then it will send the message in that language, regardless of what the site language is set to.

Since you only have one site and it’s set to sl-SI, it’s not possible for you to edit the English translation of system messages. Which is why Craft is using the system’s default translation.

If you want to test your translated system messages, change the user account’s preferred language to Slovenian first.

@krizajb

This comment has been minimized.

Copy link
Author

commented Jan 21, 2019

How do you then justify the forgot_password_subject subject and forgot_password_body mail? Either way, this took me way to long to figure out and I wasn't able to google anything about it making it it a very bad design. Maybe the user should somehow be notified on how the Message system works if being miss used?

@brandonkelly brandonkelly reopened this Jan 21, 2019
@brandonkelly

This comment has been minimized.

Copy link
Member

commented Jan 21, 2019

Sorry, it wasn’t clear to me that the messages were coming with literal “forgot_password_subject” and “forgot_password_body” strings, as opposed to their English translations.

I’ve been able to reproduce that, and about to commit a fix…

@krizajb

This comment has been minimized.

Copy link
Author

commented Jan 21, 2019

Great! Sorry if I wasn't able to make it clear :) Thank you!

@brandonkelly

This comment has been minimized.

Copy link
Member

commented Jan 21, 2019

No worries, it was a complicated issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.