0

I'm working on azure devops pipeline and using Azure devops global Notification to send email. Currently I'm able to send my custom error message on mail by using below commands.

echo "##vso[task.logissue type=error]Invalid User Input -- Variables with empty values or with only white spaces found!"

Same i want to send on mail for success custom message by azure devops notification something as below mention ##vso[task.complete result=Succeeded;] all user input value is successfully validated

but for success or other logs message it is not sending on mail..

abhishek
  • 1
  • 3

2 Answers2

0

Logging commands are how tasks and scripts communicate with the agent. They cover actions like creating new variables, marking a step as failed, and uploading artifacts. Logging commands are useful when you are troubleshooting a pipeline. However, Azure DevOps global Notification service doesn't support customization like sending email including attachments.

In addition, as a workaround, we can use the 3rd-party extension: Send Email, which supports to configure body and add attachment. enter image description here

Edward Han-MSFT
  • 2,879
  • 1
  • 4
  • 9
  • can we send all logging commands output on mail through Azure Devops Global Notification? – abhishek Apr 09 '21 at 05:52
  • Tested and found that Azure DevOps Global Notification only contains content which shows in the build summary, and now it doesn't show all logging commands output like ```task.logissue type=error``` and ```task.complete result=Succeeded;``` will only show error message in notification. – Edward Han-MSFT Apr 09 '21 at 05:58
  • Hi abhishek, Does it work if you use the extension: Send Email? Please check it and kindly let us know the result. Thank you. – Edward Han-MSFT May 18 '21 at 03:34
0

I have never tried but you can use Power shell script for this purpose. Install the module and you can pass all variables into script

Adding microsoft mail command document for your reference.

[https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7.1#:~:text=The%20Send-MailMessage%20cmdlet%20sends,to%20a%20valid%20SMTP%20server]