function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Guillaume ZeemanGuillaume Zeeman 

Reset (site) password not sending email for community public user with visualforce template

We are trying to create a custom forgot password page where an user can request a reset of their password. We are using a Visualforce email template with a custom Visualforce component to customize the content of the email.

Unfortunately, no email is received if we add an apex controller class to our custom Visualforce component. So, if we use an custom Visualforce component with no Apex controller and some static text, the user receives a reset email. But if we use an custom Visualforce component with an empty Apex controller and some static text, the user does not receive a reset email.

We have added the apex controller to both the profile and permission set of the public community user, to no avail. When we create an email log file, we see that no emails are sent. Does anyone have any suggestions to resolve this issue?

Our setup

We have a Lightning community with a custom "Forgot password" page. We added a custom LWC component where a user can enter their username. When the press "Submit", we call the "Site.forgotPassword()" method with the provided username.

We use a Visualforce email template to send the email. The template is located in a public folder. The template contains a custom Visualforce component that has a custom Apex controller linked.

The custom Apex Controller is added to the profile and permission set of the public community user. Email deliverability access level is set to 'All email'.

Guillaume ZeemanGuillaume Zeeman
We also added the Apex controller to the profile and permission set of the user who should receive the reset email.
Raphael WeberRaphael Weber
we also face the same issue. did you find a solution?
Prakash Rai 7Prakash Rai 7
Check if Deliverability Access Level is set to `System email only` or `All email` to allow outbound email from Salesforce.