LogoLogo
WordPress.orgExtensionsSupport
Version 6
Version 6
  • Notification – Custom Notifications and Alerts for WordPress
  • Known issues
  • User guide
    • How Notification plugin works
    • Who can use this plugin
    • How to create Notifications
    • Custom Post Type support
    • How to escape { character
    • Background processing
    • Troubleshooting
    • How to setup different FROM address for different Notifications
  • Developer
    • General
      • Plugin loading chain
      • Extension possibilities
      • Creating an extension
      • Bundling Notification plugin
      • White label mode
    • Notifications
      • Suppressing the Notification
      • JSON synchronization
      • Programmatic Notifications
    • Triggers
      • List of all default Triggers
      • Custom Trigger
      • Enable support for non-public Custom Post Type
      • Adding Merge Tags to existing Triggers
      • Postponing the Trigger action
      • Delaying Trigger execution with Cron
    • Carriers
      • Suppressing the Carrier
    • Snippets
      • General
        • Automatic Trigger testing
        • Allow other roles to edit Notifications
      • Triggers
        • Post
        • User
      • Integations
        • WP All Import
        • MemberPress
        • Gutenberg
  • Extensions
    • Installation
    • Planned extensions
    • 3rd Party Extensions
    • Custom Fields
    • Scheduled Triggers
Powered by GitBook
On this page

Was this helpful?

  1. Developer
  2. Snippets
  3. Triggers

User

Adding default Merge Tags to "User registered" Trigger

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() );

} );
PreviousPostNextIntegations

Last updated 5 years ago

Was this helpful?