Can't send an email to recover password

Faced with the issue that the user is not sent a letter when requesting to change the password. The email template exists and it is assigned to the business event.

From the documentation it should work, but it doesn’t. Mail settings on the site have not changed

Hi @valeria.zaviriukha,

this could be an issue with your template. Does a template test mail get sent?

Otherwise you should be able to find something in the log files under var/log.

Kind regards,
Patrick

Hi @PatrickHoelscher and thank you for your answer!

About template - earlier emails from this template of the site were sent. But then the site database was re-uploaded and after that the letters were no longer sent.

Depending on information from var/log - have this error message:
app.ERROR: Could not render Mail-Template with error message: Failed rendering string template using Twig: Variable „customer“ does not exist in „9a19555604feb07a124be2ff355ec368“ at line 1. Error Code:0 .

Do I understand this error correctly - the „customer“ value has disappeared from the database? If so, are there any ways to restore this information in the database?

Kind regards,
Valeria

Hi @valeria.zaviriukha,

It should work, if you replace the „customer“ variables with the following.
Firstname: {{ userRecovery.user.firstName }}
Lastname: {{ userRecovery.user.lastName }}

Kind regards,
Patrick

Hi @PatrickHoelscher,
thank you for your help!

I checked this option, but it didn’t work either. The letter for some unknown reason does not parse the values. {{customer.title}} {{customer.firstName}} {{ customer.lastName }}, {{ userRecovery.user.firstName }}, {{ userRecovery.user.lastName }}, {{ urlResetPassword }} not working. if I delete all these values, then the letter will come to the mail.

Kind regards,
Valeria

Hi @valeria.zaviriukha ,

did you remove the {{customer.title}} {{customer.firstName}} {{ customer.lastName }} from the template when using the other variables?

Alternatively, you can also trigger the business event via the storefront and check the logs again. There should be a similar error message as the one before.
Then you can remove the variables one by one, depending on what the error message says.

In my testing environment {{ userRecovery.user.firstName }}, {{ userRecovery.user.lastName }}, {{ urlResetPassword }} all worked fine (SW 6.4.3.1).
Otherwise, what version of Shopware are you using?

Kind regards,
Patrick

mycardstatement Wrote:

Thanks for help, Looking for same issue and it’s work for me, Really appreciate for help.

Hi @PatrickHoelscher !
Yes, I checked it right after your recommendation. A letter without variables (just text) comes, but if i add variables (no matter which one - {{customer.title}} or {{ userRecovery.user.firstName }} ), the letter stops coming. I found the same problem with subscribing to the newsletter.

Hi @valeria.zaviriukha,

What messages do you get in the logs? The same as before?

Otherwise another variable, that you could try is
{{ customerRecovery.customer.firstName }}

Kind regards,
Patrick

@PatrickHoelscher good day and I apologize for missing.
The problem was solved by replacing non-working variables with working ones. As far as I know, they differ from those that you suggested, but the essence remains the same.
Thank you for your help and all the best to you!

Kind regards,
Valeria