1
2
3
4
5
6
7
8
9
10
11
12
<?php

class CustomPageComment extends DataObjectDecorator {

  function onAfterWrite() {
    $email = new Email(); 
    $email->setTo('[email protected]'); 
    $email->setSubject('New Comment'); 
    $email->setFrom('[email protected]');
    $email->send();
  }
}