Won't send the template in mailer

Hellow Good evening. I’ve been having trouble in my code for the forgot_password. in the code i will send the template inside the email/html/forgot_password but the only thing i receive in my email is “forgot_password”. I would be glad for some help or tips in solving my problem.

here are the codes:

thank you for the help!

I’ve always used Mailer for this, not Email. It looks like maybe you can do it by calling setProfile with some parameter that tells it what template to use, perhaps ['template' => 'forgot_password']. But looking at the code, it’s clear that the parameter to the send function is taken as content to send, not the name of a template.

P.S. Please paste code as formatted text, not as images. You’re more likely to get good help that way.

1 Like

I’d also recommend you use the Mailer class since the Email class has been removed in CakePHP 5.0


i have now configured my code and it’ll send the email with the link. but when i press the link it’ll say “The previous page is sending you to an invalid url” then the url is the reset-password/sabajbgjadbgjadbg. i haven’t used hosting yet in my project. correct me if im wrong, do i need to host it first? thank you so much.

Thank you your advice helped me a lot