One pager site - Snippet controller - Contact form issue

Hello there,

Context ::
I am using one pager website construction.
I follow the Contact guide to build my contact form.

Because of the uid() method, i guess i can’t use the normal page controller in a controllers folder. So i use the plugin snippet controller. Maybe i miss something…

Error ::
My error message is : " The form could not be sent: The email template “email” cannot be found" It comes from $error->getMessage() in the controller file

Any help would be appreciate :smile:
Thanks
M

Did you create the email templates as per the guide?

Another way would be to use the site controller to handle your form. This will be used when a controller does not exist for a specific page template.

But it sounds like your controller is working, it just cant find the email temapltes.

Since this is a one pager, I would think the controller that is in use is the contollers/home.php contoller if that exists. you could try putting your form logic in there, rather then in the snippet contoller.

Hey
Thanks for your replay, I"ll let you know :slight_smile:
++
M

Hey :=)

I tried to put my form logic into the controllers/home.php, but it doesn’t work, the error remains the same :confused:

Any other idea ?

Thanks

I resolved my issue. I had to use controllers/home.php instead of controllers/contact.php because of the onepager system. And the email template couldn’t be found because I didn’t created it … It’s written on the cookbook > here

Thanks anyway
++
M

Yes that makes sense becaue its a one pager setup, so everthing technically belongs to the home controlller because eveything is being loaded into the home page template.

1 Like