I want to configure a workflow to send an email on an Identity Lifecycle State change.
I have managed to configure the workflow with the appropriate trigger and filters to ensure the email operation is fired on the appropriate change event. I have also managed to select the Identity (Get Identity) to read the information I want to include in the Email.
However, when I run Test Workflow and it gets to Send Email action, it generates an error “unable to send email: unable to send HTTP request: request failed: 400 - 400 Bad Request”.
The error is NOT generated if I remove the content of the ‘context’ box in the send Email action item and the email is sent. This is not a work around as I need to send content from the Identity record.
I have tried various content in the ‘context’ box based on the information in the provided docs but nothing seems to work.
I have also seen references to this error in other topics posted here that suggest it was a bug that has been fixed or I needed to include an @sailpoint.com address in the From and Reply To fields (which I have tried with no success).
Does this problem still exist for some tenants? Has anyone else seen this issue and found the solution?
Any help you can provide would be very much appreciated.
I am able to reproduce your issue. I have opened a bug report with engineering to look into it. In the meantime, there is a workaround for this. Rather than use the templating context, you can use inline variables. First, delete you email action so you don’t get the error anymore. Then, create a new email action and use inline variables in your email body. For example:
Could you confirm if the workaround supports a way for us to render the body using Apache Velocity? In the past we were able to use the quiet reference notation (e.g. $!email vs $email) to suppress the output of the reference if it is undefined.
In addition, could you also confirm if the workaround supports HTML formatted bodies? In my testing, it does not appear to.
Some Apache Velocity code seems to work when typing directly in the Email Body, however, when using if statements for checking if a variable exists or not, we get another 400 Bad Request error.
Example of velocity code that works: #set ($mobile = {{$.getIdentity.attributes.mobilePhone}}) $mobile
Example of velocity code that doesn’t seem to work(but works in regular email templates): #if($mobile)Mobile Number: $mobile #else Mobile Number is missing #end
I tried creating a net new workflow, but it still errors out with the same response. I have attached the workflow and an image of the test result. Perhaps I am doing something else wrong?