Advertisement
BakerMan

TXO - Change Email Destination

Feb 2nd, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. /**
  2.  * Change the destination address of the email.
  3.  *
  4.  * @param array $email;
  5.  * @return array
  6.  */
  7. function change_notification_addr(array $email) {
  8.     $email['to'] = 'desired@address.com';
  9.     return $email;
  10. }
  11.  
  12.  
  13. /**
  14.  * Sets up a filter to alter the behaviour of wp_mail.
  15.  */
  16. function intercept_mail() {
  17.     add_filter('wp_mail', 'change_notification_addr', 100);
  18. }
  19.  
  20. /**
  21.  * Intervene at the point where an order notification is
  22.  * going to be sent to the site administrator.
  23.  */
  24. add_action('txo_notification_email', 'intercept_mail', 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement