• Resolved redmonkey73

    (@redmonkey73)


    Hi here! We still try used this plugin for our project, now i try add custom merge tag for custom trigger, i used this manual https://docs.bracketspace.com/docs/registering-custom-triggers/ (it really good examples) but i have some problem with merge tags.
    I try add merge tag like this

    public function merge_tags() {
    		$this->add_merge_tag( new \BracketSpace\Notification\Defaults\MergeTag\UrlTag( array(
    			'slug'        => 'email',
    			'name'        => __( 'User email', 'socialbet' ),
    			'resolver'    => function( $trigger ) {
    			return add_query_arg( 'source', $trigger->param_value, site_url() );
    			//return trim($trigger->param_value);
    			},
    			'description' => __( 'Email пользователя', 'socialbet' ),
    			'example'     => true,
    		) ) );
    
        }
    
    }

    it’s work perfect with
    return add_query_arg( ‘source’, $trigger->param_value, site_url() );
    but then i try
    return trim($trigger->param_value);
    it’s return me NULL, so how i can return to merge tag just variable ?

    what am I doing wrong ?

    • This topic was modified 6 years, 3 months ago by redmonkey73.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter redmonkey73

    (@redmonkey73)

    i find, where i wrong, i used wrong merge tag class, now its work perfect

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Aha! I’m, glad you resolved it, but yeah, you have to be very specific which tag class you are using because the output is sanitized.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Merge Tags’ is closed to new replies.