Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do you get User Properties to be sent in an outgoing email (issueassigned.vm)

AndreH May 14, 2013

I know you can get custom fields to be sent in an outgoing email. Can you get custom User properties to be sent in outgoing emails?

Example under User ABC I created

Key - Phone

Value - 111-111-1111

I want to send this information in the issueassigned.vm when the issue triggers an Assigned Issue.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 14, 2013

You need to check whether the UserPropertyManager#getPropertySet(User) exists in the velocity context or not. If yes, you can use the below method:

UserPropertyManager#getPropertySet(User).get("phoneExt")

AndreH May 14, 2013

Thank you for the quick reply... I would like to see if I have the formating set properly in the vm -

#disable_html_escaping()

#if ($UserPropertyManager#getPropertySet(User).get("Phone"))

<tr valign="top">

<td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 10px 10px 0;white-space:nowrap;">

<strong style="font-weight:normal;color:${textSubtleColour};">#text("Phone Number"):</strong>

</td>

<td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;">

$UserPropertyManager#getPropertySet(User).get("Phone")

</td>

#end

</tr>

When I include this new.vm in the issueassigned.vm I get an error -

An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.ParseErrorException: Encountered "#getPropertySet" at templates/email/html/includes/fields/phonenum1.vm[line 2, column 26] Was expecting one of: <RPAREN> ... <WHITESPACE> ... "-" ... "+" ... "*" ... "/" ... "%" ... <LOGICAL_AND> ... <LOGICAL_OR> ... <LOGICAL_LT> ... <LOGICAL_LE> ... <LOGICAL_GT> ... <LOGICAL_GE> ... <LOGICAL_EQUALS> ... <LOGICAL_NOT_EQUALS> ... <DOT> ... at org.apache.velocity.Template.process(Template.java:141) at

TAGS
AUG Leaders

Atlassian Community Events