• Raphael Weber
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

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'.