I’m using gravstrap plugin&theme wherein lies a contact form which plays nicely with the given layout. The gravstrap form simply POSTs to simpleforms.com.
I gave a go at creating a plugin to receive the POST and use my own mail system to email
the form, instead of posting to simpleforms.
I chose to POST via Ajax and i would like to render a simple HTML response to my “form-messages” div.
All of the information to send the email is available at “OnPluginsInitialized” and I
send email on that event.
So possible questions are:
-
Can i render a simple response at this point in the grav lifecycle?
-
How to tell grav to continue/cleanup and move on to the next request.
$e->stopPropagation() seems to skip remaining events but grav still wants
to render a page. -
If the above in not a good idea, what other approaches might serve the
roll-your-own “simple” form approach. -
If i had to use a template to render the ajax response where to put it?
or symlink to user/plugins/form/templates from my plugin’s directory
my plugin route is /postmail