Advertisement
eventsmanager

New event: send email (untested)

Oct 2nd, 2023
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. add_filter('em_event_save','custom_event_save',1,2);
  2. function custom_event_save($result,$EM_Event){
  3.  
  4. global $EM_Mailer;
  5.  
  6. if( !is_object($EM_Mailer) ){
  7. $EM_Mailer = new EM_Mailer();
  8. }
  9.  
  10. $subject = "New event: ".$EM_Event->event_name;
  11. $body = $EM_Event->post_content;
  12. $email = "admin@gmail.com"; //add email address
  13. $attachments = array();
  14. $args = array();
  15.  
  16. if( !$EM_Mailer->send($subject,$body,$email, $attachments, $args) ){
  17. //email is not send, you can add notification
  18. }
  19.  
  20.  
  21. return $result;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement