cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anshul_syn
Advocate I
Advocate I

O365 email to VSTS task author error

Created a flow to

1. send an email to a particular person (approver) when a new VSTS task is created

2. send an email back to the VSTS author based on the action taken (approve/reject) by the approver.

 

While first email (to approver) works just fine, the second email to task author fails with below mentioned error. Approver's email-id is a fixed value, and task creater's email-id is a dynamic value fetched from 'Created By' or 'Changed By' fields of VSTS.

 

In the error-log, I can see that the system has been able to correctly fetch the email-id of task author; yet, it fails to send the email.

 

Any ideas?

 

P.S. - It's an enterprise account; email-ids are fetched from corporate AD.

 

Flow-error-1.pngFlow-error-2.pngFlow-error-3.png

 

Headers
{
  "Pragma": "no-cache",
  "x-ms-request-id": "2c763f14-27d0-469a-bf1e-6787de9e4c8f",
  "X-Content-Type-Options": "nosniff",
  "Cache-Control": "no-cache",
  "Date": "Mon, 06 Mar 2017 07:28:07 GMT",
  "Set-Cookie": "ARRAffinity=a4627bf26dba653b373af9fb21c5376f3d8ad4625129ad650553c8bcdbeeaad8;Path=/;Domain=127.0.0.1",
  "Server": "Microsoft-IIS/8.0,Microsoft-HTTPAPI/2.0",
  "X-AspNet-Version": "4.0.30319",
  "X-Powered-By": "ASP.NET",
  "Content-Length": "83",
  "Content-Type": "application/json; charset=utf-8",
  "Expires": "-1"
}



Body
{
  "status": 400,
  "message": "One or more recipients are invalid.",
  "source": "127.0.0.1"
}
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @anshul_syn,

 

Apologize for missing the second error message.

In your screenshot the error message told that the email Address is in the wrong format.

I got the same results, doing some more research, I found that the dynamic content from VSTS service would give the [Created By] the following value:

YourName(Company)<Email Address>

And this value can't be recognized by the Send Email Action.

We could take use of the following workaround to pickup the Email Address only:

1. Add a Compose Action after the "Wehn a work item is created" trigger (we could also add this Compose under the Yes or No field as option 2), 

2. Under the input, copy and paste the following:

"@split(split(triggerBody()?['fields']?['System_CreatedBy'], '<')[1],'>')[0]"

3. Then under the Send Email Action, use the Outputs Dynamic Content of the Compose Action instead of the Created By.

See screenshots:

28.PNG

29.PNG

If you have any further questions, please post back.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-micsh-msft
Community Support
Community Support

Hi @anshul_syn,

 

I think the issue here should be the Switch you used.

Switch Condition checks the results from the Inputs, and matches the results with the value defined within the switch, which I don't think could work properly with the Send Approval Email Action.

Here I think we should use the Condition. Please follow the screenshot below to configure the Flow, see if it works:

25.PNG

 

More reference:

Add a condition to a flow

 

If you have any further questions, please post back.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-micsh-msft

 

Thanks for your response!

 

I tried what you suggested; however, it's still failing with the same error.

Flow-error-6.pngFlow-error-7.png

 

Hi @anshul_syn,

 

Apologize for missing the second error message.

In your screenshot the error message told that the email Address is in the wrong format.

I got the same results, doing some more research, I found that the dynamic content from VSTS service would give the [Created By] the following value:

YourName(Company)<Email Address>

And this value can't be recognized by the Send Email Action.

We could take use of the following workaround to pickup the Email Address only:

1. Add a Compose Action after the "Wehn a work item is created" trigger (we could also add this Compose under the Yes or No field as option 2), 

2. Under the input, copy and paste the following:

"@split(split(triggerBody()?['fields']?['System_CreatedBy'], '<')[1],'>')[0]"

3. Then under the Send Email Action, use the Outputs Dynamic Content of the Compose Action instead of the Created By.

See screenshots:

28.PNG

29.PNG

If you have any further questions, please post back.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you @v-micsh-msft; this trick worked!

 

However, is there a better and more intuitive way to do it? May be, if 'Send Email' action can recognize and accept the email-id directly from VSTS 'Created By' field? Is this something that can be included in the upcoming version of MS Flow?

Hi @anshul_syn,

 

Based on what I know, there seems to be not available to have the Email Address directly in Dynamic content generated from the attribute of the workitem.

You could consider submit an idea on this, in the Microsoft Flow idea forum:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

Regards

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,759)