nsc Posted June 3, 2019 Share Posted June 3, 2019 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 More sharing options...
nsc Posted June 3, 2019 Author Share Posted June 3, 2019 Solved it by adding the code to init.php instead! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now