I have written a function (child-theme; functions.php) for the plugin Event-Manager in Wordpress. This function reads values out of custom input fields and saves those in the databse.
I would like to write a custom Placeholder in order to place it in the email notification.
The function is:
function em_save_custom_event_fields() {
global $EM_Booking;
if(!empty($_REQUEST['user_motorcycle'])) {
$EM_Booking->booking_meta['registration']['user_motorcycle'] = wp_kses($_Request['user_motorcycle'], array());
}
}
add_filter('em_booking_add, em_save_custom_event_fields');
For the email notification I would like to add a new placeholder called #_USERMOTORCYCLE in the template that actually replaces the placeholder with the value that was provided by the user and stored at:
$EM_Booking->booking_meta['registration']['user_motorcycle']
I have searched the web and found some samples but as a novice I am not able to apply them to my requirements.
Create a Custom Placeholder for Event Formatting
and
Show specific database value in notification email
I have written a function (child-theme; functions.php) for the plugin Event-Manager in Wordpress. This function reads values out of custom input fields and saves those in the databse.
I would like to write a custom Placeholder in order to place it in the email notification.
The function is:
function em_save_custom_event_fields() {
global $EM_Booking;
if(!empty($_REQUEST['user_motorcycle'])) {
$EM_Booking->booking_meta['registration']['user_motorcycle'] = wp_kses($_Request['user_motorcycle'], array());
}
}
add_filter('em_booking_add, em_save_custom_event_fields');
For the email notification I would like to add a new placeholder called #_USERMOTORCYCLE in the template that actually replaces the placeholder with the value that was provided by the user and stored at:
$EM_Booking->booking_meta['registration']['user_motorcycle']
I have searched the web and found some samples but as a novice I am not able to apply them to my requirements.
Create a Custom Placeholder for Event Formatting
and
Show specific database value in notification email
1 Answer
Reset to default 0Struggling with the same issue at the moment. It seems that placeholders are scattered everywhere through the plugin files making it a little difficult to reproduce.
Edit: Alright, it seems that there might be an easier way though I'm sure you might need to keep looking for something better. Go to the events-manager/classes folder, and open em-booking.php. In the output function you can add your own placeholder. Something along the lines of:
case '#_USERMOTORCYCLE':
$replace = $this->get_person()->user_motorcycle;
break;
That should do the trick for now.