Recent Topics

1 Mar 03, 2017 01:39    

Newsletters how remplace Hello $login$! by full name ?

3 Mar 04, 2017 08:21

You can try:


It seems the only ones supported in mail is $username$ and $login$


		if( ! empty( $User ) )
		{ // Replace $login$ with gender colored link + icon in HTML format,
		  //   and with simple login text in PLAIN TEXT format
			if( $format == 'html' )
				$username = $User->get_colored_login( array(
						'mask'      => '$avatar$ $login$',
						'login_text'=> 'name',
						'use_style' => true,
						'protocol'  => 'http:',
					) );

				$user_login = $User->get_colored_login( array(
						'mask'      => '$avatar$ $login$',
						'use_style' => true,
						'protocol'  => 'http:',
					) );
				$username = $User->get_username();
				$user_login = $User->login;
			$formated_message = str_replace( array( '$login$', '$username$' ), array( $user_login, $username ) , $formated_message );

not supported in mail?

// avatar_name | avatar_login | only_avatar | name | nickname | firstname | lastname | fullname | preferredname

4 Mar 04, 2017 12:17

That's true. There is no standard way to accomplish that in the current stable version (neither beta, nor dev branches).

Those are two different concepts:

  1. Newsletters use get_colored_login which currently supports $login$ and $avatar$ only, and doesn't produce a link as its output, just the image and text.
  2. The tag User::get_identity_link() implements many other placeholders to be displayed within a link to the user's profile page.

In short, maybe we can find a way to somehow merge both features to let insert any of the user related tags into emails. Also, this thread may let us to open up the scope into new concepts, like general use tags or so, to retrieve info from posts, files, etc. and not only from users. I will cut it off at this point, just to not mix things, think a bit more about it and discuss using our regular channels. However, ideas about what I just said are welcome, of course.

Form is loading...