VMware Cloud Community
jallyn
Contributor
Contributor

vra 8.1 ABX actions to send email

I'm looking to send email notifications to the requesting user when deployments start/finish/fail. Accomplishing this with ABX seemed to be logical and easy, but in examining the payload for the "Deployment Requested" event type only the username is passed and not the email address of the requester. I then thought I might be able to pull this from the identity API, but I get a 403 Forbidden when trying to work with the UserController (org owner permissions). 

My question would be has anyone else tried something similar to any success? What method might you be using?

Thanks!

0 Kudos
2 Replies
MikeNox
Enthusiast
Enthusiast

LOL.  I had this same issue.  Why can we pull the requested by (username) but not the display name or email address?  I ended up creating a vro action that takes in the requested by and passed back the email address.  I then add that to the properties of the virtual machine and retrieve it when needed.

Hopefully someone from VMware reads this and either exposes the email address or points me to a better solution.

0 Kudos
legioon
Enthusiast
Enthusiast

If you integrated your vRA environment with Active Directory or LDAP, username might be already email address.

If so, you can get requester email address/username by listing all property of deployment with ABX Action.

import json

def handler(context, inputs):

    print(json.dumps(inputs, indent=2))

0 Kudos