• Resolved Daniel

    (@skylayer)


    Hey,

    awesome, really awesome plugin. I saw in you documentation that you allow for custom merge tags, and I’ve seen that someone else posted a similar question. However, could you point me into the direction of enabling first_name and last_name merge tags on user registration? I have those fields enabled on the registration page. If you could do that with your plugin all notifications sent to the user would become a lot more personal.

    I really appreciate any help.

    Thanks,
    Daniel

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Kuba Mikita

    (@kubitomakita)

    Thank you Daniel for your kind words!

    You should be good by adding this snippet to your code:

    add_action( 'notification/trigger/registered', function( $trigger ) {
    
    	if ( $trigger->get_slug() !== 'wordpress/user_registered' ) {
    		return;
    	}
    
    	$trigger->add_merge_tag( new BracketSpace\Notification\Defaults\MergeTag\User\UserNicename() );
    	$trigger->add_merge_tag( new BracketSpace\Notification\Defaults\MergeTag\User\UserDisplayName() );
    	$trigger->add_merge_tag( new BracketSpace\Notification\Defaults\MergeTag\User\UserFirstName() );
    	$trigger->add_merge_tag( new BracketSpace\Notification\Defaults\MergeTag\User\UserLastName() );
    	$trigger->add_merge_tag( new BracketSpace\Notification\Defaults\MergeTag\User\UserBio() );
    
    } );

    I’d be very grateful if you could spare 30 seconds to write a review here. Thanks!

    Thread Starter Daniel

    (@skylayer)

    Dear Kuba,

    thanks so much for your swift and competent reply, that did the trick indeed.

    My use case:

    A content syndication website without WooCommerce etc., users can register to see the content. With your little snippet I can now build personalized HTML welcome emails. My advice would be to make more merge tags available where it makes sense to people could build even greater stuff with the help of your plugin!

    Thanks again, I left a review.

    Greetings,
    Daniel

    • This reply was modified 5 years, 7 months ago by Daniel.
    Plugin Author Kuba Mikita

    (@kubitomakita)

    Awesome!

    Yeah, the reason why these merge tags are not available is that default WP form doesn’t have such fields enabled. So I’d rather point to that snippet than get many tickets because these tags doesn’t work ??

    Thread Starter Daniel

    (@skylayer)

    Yeah I totally understand that, maybe add it to your documentation in order to avoid repetition and point out that those fields need to be enabled? I was fiddling around with the Telegram Messenger post bot for WordPress and those guys kept posting their answers into the Telegram Channel rather than compiling an official, centralized spot for snippets and hacks.

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Thanks for the reminder Daniel, I wanted to do this a long time ago but never got the time or I kept forgetting about this ??

    A new category in docs: https://docs.bracketspace.com/notification/developer/snippets/triggers/user

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘First Name / Last Name on Registration’ is closed to new replies.