#Overview
This filter is run during an Event Tickets registration, after WP Fusion has collected the event and attendee data. It can be used to sync additional data from an Event Tickets registration to custom fields in your CRM.
To use the code examples below, add them to your active theme』s functions.php file.
#Parameters
$update_data: (array) This is an array of key value pairs representing WordPress meta fields and their corresponding values.
$attendee_id: (int) The Event Tickets attendee ID
#Examples
#Override attendee emails
This example overrides the email addresses of attendees to include the event name that the attendee registered for.
The email address synced to the CRM will then be formatted like email+{event_name}@domain.com
function alt_emails_for_attendees( $update_data, $attendee_id ) {
$email_parts = explode( '@', $update_data['user_email'] );
// Convert [email protected] to [email protected]:
$update_data['user_email'] = $email_parts[0] . '+' . strtolower( $update_data['first_name'] ) . '@' . $email_parts[1];
// Or, __alternate method__: Convert [email protected] to [email protected]:
$event_name = sanitize_title( $update_data['event_name'];
$update_data['user_email'] = $email_parts[0] . '+' . $event_name . '@' . $email_parts[1];
return $update_data;
}
add_filter( 'wpf_event_tickets_attendee_data', 'alt_emails_for_attendees', 10, 2 );
#Was this helpful?
Let us know if you liked the post. That』s the only way we can improve.
Yes
No