VMware Cloud Community
orian
Hot Shot
Hot Shot
Jump to solution

request mail user

Hi,

How can I get the mail of a user who requests from the VRA catalog?

I want to send him a successful mail when a workflow in finished.

I don't want to use the built-in mail of the vra because it doesn't have enough information and cannot be customized easily.

I saw the __asd_requestedFor attribute, but it is the login name of the user.

The login name and the mail address is not the same in our organization.

When using the build-in mail notification in the VRA, it knows to send it to the correct mail user...

Thanks!

1 Solution

Accepted Solutions
orian
Hot Shot
Hot Shot
Jump to solution

I finally use this way:

requesterLogin = Server.getCurrentLdapUser().loginName;

System.log(requesterLogin);

var userName = requesterLogin.substring(0,requesterLogin.indexOf("@"));

var userObjects = new Array();

var userObjects = ActiveDirectory.searchRecursively("User", userName);

for each (var userObject in userObjects){

  break;

}

email = userObject.getAttribute("mail");

System.log(email);

View solution in original post

4 Replies
filosmith
Enthusiast
Enthusiast
Jump to solution

Try Request Info -> Requested By -> Email   or   Request Info -> Requested By -> Principal ID.

Reply
0 Kudos
orian
Hot Shot
Hot Shot
Jump to solution

hi,

Can you clarify your answer?

How do I get the mail with the VRo?

Thanks!

Reply
0 Kudos
filosmith
Enthusiast
Enthusiast
Jump to solution

I'm making some assumptions here, but if your directory is configured appropriately, you could add an "email address" input to your workflow, and then link it to the requestor's email address in the XaaS blueprint, like this:

pastedImage_0.png

Or, you could look it up some other way with Orchestrator from the requestedFor property. The details would depend on your directory.

Reply
0 Kudos
orian
Hot Shot
Hot Shot
Jump to solution

I finally use this way:

requesterLogin = Server.getCurrentLdapUser().loginName;

System.log(requesterLogin);

var userName = requesterLogin.substring(0,requesterLogin.indexOf("@"));

var userObjects = new Array();

var userObjects = ActiveDirectory.searchRecursively("User", userName);

for each (var userObject in userObjects){

  break;

}

email = userObject.getAttribute("mail");

System.log(email);