Topics

Tribe Support

Tribe Support's Topics

Scott Crawford

Scott Crawford

April 08 2017

mailAdmins available to com_pages?

I noticed in the com_mailer that the mailer.php behavior includes a function for mailAdmins, which I see is used, for example, by the com_people controller.

Would the mailAdmins funtion also available for use via com_pages?  I would assume a plugin would be required, but the intent would be a very lightweight contact form where the form is rendered via a com_pages page, and the submit button triggers the mailAdmins function.

I see the com_pages content controller primarily deals with the content path(s) being rendered... if a 'contact' plugin would be required, would it be correct to extend the ComPagesControllerPage class?

  • 5 Comments
  • Last Comment by Scott Crawford
I currently just use https://formspree.io/ in a page for a contact page.

It would depend where you're submitting the contact form to (ei the form action). Sending the contact form to the main page controller prolly wouldn't be the best idea.
Rastin Mehr
Rastin Mehr
April 09 2017 Permalink
com_pages is not intended to handle POST requests; only GET requests.
Rastin Mehr
Rastin Mehr
April 09 2017 Permalink
But you can make a component and make an ajax POST request to that component from any of the pages.
Unkown Person liked this
Scott Crawford
Scott Crawford
April 09 2017 Permalink
I tried a "one-page" contact form that relied on javascript... it worked stand-alone, but when I tried within com_pages it wouldn't function - I suspect it was the limitations around the POST action, which makes sense now.

For a contact form -type feature I do like the concept of the mailAdmins being relied upon... as the project team grows the app can accommodate.
Scott Crawford
Scott Crawford
April 09 2017 Permalink
@nicholasjohn16 Formspree looks interesting, moreso considering it's free for the first 1,000 submissions per month - which I can't imagine surpassing at this stage.

Powered by Anahita