Advertisement
verygoodplugins

Untitled

Jan 31st, 2020
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. function alt_emails_for_attendees( $update_data, $registration ) {
  2.  
  3.     if ( ! $registration->is_primary_registrant() ) {
  4.  
  5.         $email_parts = explode( '@', $update_data['user_email'] );
  6.  
  7.         // Convert email@domain.com to email+firstname@domain.com
  8.  
  9.         $update_data['user_email'] = $email_parts[0] . '+' . strtolower( $update_data['first_name'] ) . '@' . $email_parts[1];
  10.  
  11.     }
  12.  
  13.     return $update_data;
  14.  
  15. }
  16.  
  17. add_filter( 'wpf_event_espresso_customer_data', 'alt_emails_for_attendees', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement