I have the following which works for the first array but doesn't work for the second. How can I combine the two and use sendinblue_runner($data)
once?
// Fire the function to add to the imp_customer_log table
$data = array(
'id' => '',
'customer_id' => $data['user_id'],
'event' => 'first_name',
'data' => $data['account_first_name'],
'updated_in_sib' => '0',
);
sendinblue_runner($data);
// Fire the function to add to the imp_customer_log table
$data = array(
'id' => '',
'customer_id' => $data['user_id'],
'event' => 'last_name',
'data' => $data['account_last_name'],
'updated_in_sib' => '0',
);
sendinblue_runner($data);
And then I have my runner:
// Runner to grab data from all the functions that affect SiB contact fields
function sendinblue_runner($data) {
global $wpdb;
$table = "imp_customer_log";
$wpdb->insert( $table, $data );
}