Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Salutations in Mail Notifications (USR Token)

Highlighted
Nick Bucher
Super Collector

Salutations in Mail Notifications (USR Token)

Hi,

In workflows we like to send notifications with a salutation like “Dear Mr. Smith”.

 

This is possible with the active user:

Dear Mr. [USR="[SYS.USERNAME]".LAST_NAME]

 

In our workflows the most mails goes to persons which are defined in request fields.

We store in the hidden value the User ID. The problem is that the USR Token only accepts the username and not the User ID to get the last name.

 

So this two Tokens not working:

Dear Mr. [USR="[REQD.P.PROJECT_MANAGER]".LAST_NAME]

Dear Mr. [USR="30134".LAST_NAME]

 

I don’t like to store the usernames in the hidden field values, because the username could change… the User ID not.

Do you have any idea how we could use the USR Tokens with User IDs?

 

Regards

Nick

10 REPLIES
Celil
Esteemed Contributor

Re: Salutations in Mail Notifications (USR Token)

Hi,

 

Did you try this:

[USR="[USR="[REQD.P.PROJECT_MANAGER]".USER_ID]".LAST_NAME]

 

If it's not helpful please inform me to try to find another solution.

 

Celil

Celil

IT Governance Professional
& PPM Solution Architect
Nick Bucher
Super Collector

Re: Salutations in Mail Notifications (USR Token)

Hi Celil,

 

the result of your statement is:

[USR="[USR="30134".USER_ID]".LAST_NAME]

 

It looks like, that the token USR not accepts User IDs.

Probably, without a product change on HP side it is not possible to do personalized salutations in mails with a User ID.

 

regards, Nick

 

erik_c
Regular Collector

Re: Salutations in Mail Notifications (USR Token)

So Nick you're not storing the username in the VP?

[USR="[REQD.VP.PROJECT_MANAGER]".LAST_NAME]

would typically work for the VP. Or maybe try...

[USR="[USR="[REQD.P.PROJECT_MANAGER]".USERNAME]".LAST_NAME]

Nick Bucher
Super Collector

Re: Salutations in Mail Notifications (USR Token)

Thanks, but your suggestions are not working.

 

To clarify it, I store in request fields for persons following values:

 

Hidden Value (REQD.P.PROJECT_MANAGER) = 30134 (User ID)

Visible Value (REQD.VP.PROJECT_MANAGER) = Doe, John (Full Name)

 

In mine opinion it is not usefull to store the username in the hidden value, because it can change (User ID not). It is also not usefull to store the username in the visible value, because it is not realy readable.

 

So it looks like, that the token reference machanismus lags on this...

Jim Esler
Honored Contributor

Re: Salutations in Mail Notifications (USR Token)

You could create another hidden field on the request and populate it with the value you want to use.

Nick Bucher
Super Collector

Re: Salutations in Mail Notifications (USR Token)

Hi Jim,

I think you are right, this would be a working solution.

But double all person fields and populate it with rules is not realy elegant and the solution I was looking for.

 

In this case we send the mails without a correct salutations...

 

Thanks anyway,

Nick

 

Kerim KILIC
Frequent Visitor

Re: Salutations in Mail Notifications (USR Token)

if u are storing fullname in vp tokens then may be u can take substring just the last name in html.

Nick Bucher
Super Collector

Re: Salutations in Mail Notifications (USR Token)

Hi kerimkilic,

thanks for your idea. But use the Java Script function substring in the email html code is probably not a good solution because Java Script is often deactivated in mail clients. We also use the Mobility Access from PPM, so we have to support a lot of different mail clients with different security settings...

regards, Nick

 

pepdwill
Senior Member

Re: Salutations in Mail Notifications (USR Token)

Three years later, just wanted to check if there's still no workaround for this.

 

As of version 9.22 the USR tokens still require the username values to work, and if the User ID values are stored as the hidden parameter of people fields, there is effectively no way to use the USR tokens.

 

Does anyone have any newer thoughts or ideas on this topic?

telefonicaecu
Acclaimed Contributor

Re: Salutations in Mail Notifications (USR Token)

Two years more, I use PPM 9.14 and I can use the token with the user_id parameter.  I added two defitinions to KNTA_ENTITIES and KNTA_ENTITY_TOKENS.  Something like this:

INSERT INTO KNTA_ENTITIES VALUES ('AMERICAN',(select max(entity_id) from KNTA_ENTITIES) +1,SYSDATE,'10',SYSDATE,'10','User2','User2','User information','USR2','Y','KNTA_USERS','USER_ID','USER_ID',null,null,null,null,34,null)
insert into KNTA_ENTITY_TOKENS values ('AMERICAN',(select max(entity_token_id) from KNTA_ENTITY_TOKENS)+1,SYSDATE,10, SYSDATE,10, 'USERNAME_FROM_ID','USR User Name From ID',null,'The username of the user logged on for the session from user id.',(select max(entity_id) from KNTA_ENTITIES) /*New entity created*/,'20','N','USER_ID','SELECT username FROM KNTA_Users WHERE user_id = :USER_ID','USER','Y',null);

 

And, I use the token:

 

[USR2="[REQD.P.TOKEN_NAME]".UD.USER_DATA_NAME]

 

//Add this to "OnDomLoad" event