<?php
/**
* Change the payment delimiter in the email notification
*
* @link https://wpforms.com/developers/how-to-change-the-payment-delimiter-inside-email-notifications/
*/
function wpf_dev_entry_email_data( $fields, $entry, $form_data ) {
// Only run on my form with ID = 310
if ( absint( $form_data[ 'id' ] ) !== 310 ) {
return $fields;
}
foreach ( $fields as $field_id => $field ) {
if ( empty( $field[ 'value_choice' ] ) ) {
continue;
// Default is a dash (-), change here to what you need
$delimiter = ' : ';
$fields[ $field_id ][ 'value' ] = $field[ 'value_choice' ] .
$delimiter . wpforms_format_amount( $field[ 'amount_raw' ], true );
add_filter( 'wpforms_entry_email_data', 'wpf_dev_entry_email_data', 10, 3 );