Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function alt_emails_for_attendees( $update_data, $registration ) {
- $email_parts = explode( '@', $update_data['user_email'] );
- // Convert email@domain.com to email+firstname@domain.com
- // $update_data['user_email'] = $email_parts[0] . '+' . strtolower( $update_data['first_name'] ) . '@' . $email_parts[1];
- // OR Convert email@domain.com to email+event_name@domain.com
- $event = $registration->event();
- $event_name = sanitize_title( $event->name() );
- $event_name = str_replace( '-', '_', $event_name );
- $update_data['user_email'] = $email_parts[0] . '+' . $event_name . '@' . $email_parts[1];
- return $update_data;
- }
- add_filter( 'wpf_event_espresso_customer_data', 'alt_emails_for_attendees', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement