Help:Growth/Mentorship/Integrating mentorship

Context
Some projects had already a mentorship system in place, used for i.e. signing the welcoming messages. Enabling the Growth features on such projects duplicated mentorship for newcomers, sometimes assigning two mentors to each newcomer. It makes sense to allow such projects to get the mentor assigned to each user, so they can integrate it with their own mentorship systems.

Magic word
This is now possible via a magic word  , which was introduced in February 2020. The magic word takes one parameter, the username of the mentee, and returns raw username of the mentor. The magic word will return an empty string in case the mentee does not have any mentor assigned (for instance, because they don't have the newcomer homepage enabled).

Usage
For example, to get the mentor of User:Martin Urbanec (WMF), one would write  , which would return the raw username of the mentor.

You can use the magic word together with the   parser function, to incorporate a fallback mechanism into your project's templates.


 * Examples :

The examples below assume that the mentee is User:Mentee, who is mentored by User:Mentor.


 * – will output Mentor
 * – will output User:Mentor
 * – used in a welcome message on the mentee's talk page, will output <tvar|1>Mentor</>
 * – used on the mentee's draft page (<tvar|1> </>), will output <tvar|2>Mentor</>
 * – will ping <tvar|1>Mentor</> the subst: part is required; pinging will not work without it