# Can't send an email to recover password

**URL:** <https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854>\
**Category:** Shopware 6 (English)\
**Tags:** general, administration\
**Created:** [19. August 2021 um 08:51 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854 "2021-08-19T08:51:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![valeria.zaviriukha](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@valeria.zaviriukha](https://forum.shopware.com/u/valeria.zaviriukha)\
**Post date:** [19. August 2021 um 08:51 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854/1 "2021-08-19T08:51:55Z")

</div>

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.

 ![Снимок экрана 2021-08-19 в 11.39.22](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/f/fc6162c2fea18394326b8502a3504d65ce6471e3.png)

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

---

<div class="post-metadata">

**Author:** ![PatrickHoelscher](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/patrickhoelscher/32/21102_2.png) [@PatrickHoelscher](https://forum.shopware.com/u/PatrickHoelscher)\
**Post date:** [20. August 2021 um 06:20 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854/2 "2021-08-20T06:20:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![valeria.zaviriukha](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@valeria.zaviriukha](https://forum.shopware.com/u/valeria.zaviriukha)\
**Post date:** [20. August 2021 um 08:09 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854/3 "2021-08-20T08:09:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PatrickHoelscher](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/patrickhoelscher/32/21102_2.png) [@PatrickHoelscher](https://forum.shopware.com/u/PatrickHoelscher)\
**Post date:** [20. August 2021 um 10:51 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854/4 "2021-08-20T10:51:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![valeria.zaviriukha](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@valeria.zaviriukha](https://forum.shopware.com/u/valeria.zaviriukha)\
**Post date:** [20. August 2021 um 12:15 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854/5 "2021-08-20T12:15:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PatrickHoelscher](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/patrickhoelscher/32/21102_2.png) [@PatrickHoelscher](https://forum.shopware.com/u/PatrickHoelscher)\
**Post date:** [20. August 2021 um 13:19 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854/6 "2021-08-20T13:19:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mark19](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@mark19](https://forum.shopware.com/u/mark19)\
**Post date:** [24. August 2021 um 11:19 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854/7 "2021-08-24T11:19:01Z")

</div>

> [@PatrickHoelscher](#):
>
> 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](https://www.mycardstatement.pro/) Wrote:

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

---

<div class="post-metadata">

**Author:** ![valeria.zaviriukha](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@valeria.zaviriukha](https://forum.shopware.com/u/valeria.zaviriukha)\
**Post date:** [25. August 2021 um 08:45 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854/8 "2021-08-25T08:45:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PatrickHoelscher](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/patrickhoelscher/32/21102_2.png) [@PatrickHoelscher](https://forum.shopware.com/u/PatrickHoelscher)\
**Post date:** [25. August 2021 um 12:21 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854/9 "2021-08-25T12:21:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![valeria.zaviriukha](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@valeria.zaviriukha](https://forum.shopware.com/u/valeria.zaviriukha)\
**Post date:** [1. September 2021 um 09:23 UTC](https://forum.shopware.com/t/cant-send-an-email-to-recover-password/89854/10 "2021-09-01T09:23:25Z")

</div>

@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
