Hey there lostd,
How are you doing today?
Something like this would have to be custom coded, so you’d have to add another macro that would pull the ID of the user.
Please try adding the following to your theme functions.php (Ideally you’d want this added into a child theme functions.php so you can avoid losing it each time you update the theme):
add_filter( 'ms_model_communication_comm_vars', 'ms_model_communication_comm_vars_cb', 99, 4 );
function ms_model_communication_comm_vars_cb( $comm_vars, $type, $member, $subscription ) {
$comm_vars['%ms-user-id%'] = 'User ID';
return $comm_vars;
}
add_filter( 'ms_model_communication_send_message_comm_var-%ms-user-id%', 'ms_model_communication_send_message_comm_var_cb', 99, 5 );
function ms_model_communication_send_message_comm_var_cb( $var_value, $type, $member, $subscription, $invoice ) {
// Set a prefix
$prefix = '';
// Set a suffix
$suffix = '';
$user_id = get_current_user_id();
return $prefix . $user_id . $suffix;
}
Once you add that you can add %ms-user-id% as macro into any automated email template and the user ID will be displayed in the email.
Please note that the macro will not be available in the dropdown in the admin.
Hope this helps ??
Cheers,
Bojan