Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Include email in link dynamically

tims
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 15, 2018

I'm looking to embed a variable in links that passes the currently logged-in user's e-mail in the URL.

Example:

https://www.softwarepackage.com/newform?email=[$current_user_email]&othervariable=somevalue

 

I've come across quite a few variations of my question, but haven't been able to pin down one that I can adapt to get the functionality I'm looking for.

1 answer

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 23, 2018

Hello Tim, good question right there.

For you to insert the user email, you can do this:

## @noparams
<a href="https://www.softwarepackage.com/newform?email=$action.remoteUser.email&othervariable=somevalue">This Link Name</a>

You will need to create a user macro with the escaped setting under macro body processing. The code above is all that is needed within the macro to return the link with the user email.
The $action.remoteUser.email is responsible for returning the current user email. You can get more information on this class right here:

ConfluenceActionSupport

Let us know if this helps your case!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events