Reply To: Send "username" in email instead of sender


Home Forums Front End PM PRO Send "username" in email instead of sender Reply To: Send "username" in email instead of sender

#3225
shamim
Keymaster

assuming your php version 5.3+
Add following code in your theme’s functions.php (child theme’s if any)


add_filter( 'fep_eb_email_legends', function( $legends, $post ){
	$legends[ 'sender_username' ] = array(
				'description' => __('Sender Username', 'front-end-pm'),
				'where' => array( 'newmessage', 'reply' ),
				'replace_with' => ! empty( $post->post_author ) ? fep_get_userdata( $post->post_author, 'user_login', 'id' ) : ''
				);
	return $legends;
	
}, 10, 2);

Then go to Dashboard > Front End PM > Settings > Emails. use {{sender_username}} to send username in emails.