Jump to content

Hooks for front end edits


nsc
 Share

Recommended Posts

Hi there,

Been working with ProcessWire for a while now and have just started having a play with Hooks.

I'm trying to generate an email when the page is updated from the front end, although I've only managed to get this to work when updating via the backend.

My code in finished.php

$this->addHookAfter('Page::changed', function(HookEvent $event) {
  $m = new WireMail();
	$m->to('email@email.com')
	  ->from('email@email.com')
	  ->subject('Page has been changed!')
	  ->body('Content')
	  ->send();
});

Can anyone help out or point me in the right direction?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...