No my custom code is perfect. I just needa hook to change #comentorname# from username to user firstname + lastname.
Any chance we can apply hook to change the #comentorname# ?
Plugin Author
Bunty
(@bhargavbhandari90)
You can use the same hook I share previously. Check the hook in the code, you will understand.
function cmnt_modify_content_tokens( $tokens ) {
$tokens[1] = str_replace( ‘Reply To: ‘, ”, $tokens[1] );
return $tokens;
}
add_filter( ‘cmt_mtn_replace_email_sub_placeholders’, ‘cmnt_modify_content_tokens’ );
You have shared above hook. In $tokens[1], I will probably get all the email content along with commentor name, but it will be hard to get what the commentor name is in the email content. Also I can’t print $tokens on frontend as it is used for sending emails.
if args in cmt_mtn_replace_email_sub_placeholders filter functions returns the current user id, I can achieve this somehow, but I am not sure what exactly it returns except email content.
Thank you Bunty,
I think I got the context of tokens now.
Just setting up $tokens[3] = $full_name; will solve this issue.
Thank you so much for your help!