How do I send html email with work items delivered from last build in VSTS? - azure-devops

I am trying to automate the release workflow by using VSTS pipelines, the component which i need to deliver is basically a library.
The VSTS pipeline is now building the Visual Studio solution and generating the binary files in the artifacts folder, but i need to send an email to the QA team with the list of work items which have been delivered as part of the release.
I have found a VSTS task in the marketplace which generates the release notes using MD files:
https://marketplace.visualstudio.com/items?itemName=richardfennellBM.BM-VSTS-GenerateReleaseNotes-Task&targetId=b4f49e36-84e5-48a6-b338-51f8ecc1d8d7
However, what I need is a task based on a customizable HTML template and send in the attachments a ZIP file with the content of the artifacts folder.
Anyone know how could i implement this behaviour as part of the pipeline?

How do I send html email with work items delivered from last build in VSTS?
In fact, you have already found the answer, just need to go one step further.
In the Usage and Description of Types of Template about that extension, you could get the following instructions:
but it also possible to generate other formats such as HTML with
appropriate templates.
The use of a template allows the user to define the layout and fields
shown in the release notes document. It is basically a markdown file
(or other format of your choice)
So, this extension should supports HTML format.
As test, I add that task with html template file build-basic-template.htm:
Note: Set the Output file with .htm format and template here (I use the first one).
Besides, if you want to seed email with this .htm file, you could use the Build Notification task or Send email task.
Hope this helps.

Related

Adding your own basic templates using MJML

MJML looks great for what I want to use it for.
I want to create a set of templates so that it's much easier for my co-workers to build emails in the future. However, the 'basic' and 'gallery' sections don't have an option to be populated, can I create my own templates for these sections? It'd be nice to start a project without having to duplicate an existing one.
It'd be great if this is achievable without having to download the source code and rebuild it,
Thanks.
Although not explicitly mentioned, I suppose you're referring to Mailjet's gallery of templates.
You cannot add your own templates to the default Mailjet gallery. However, it's easy to create your own templates that will then appear under "My templates".
To do so, simply create a template in drag and drop, import a MJML file (that you can edit with the MJML editor or in drag and drop), or import a HTML file.
Finally, if you need to share those templates:
Inside the same Mailjet Master Account: you can share templates from a master account to each subaccount (see doc)
Between two Mailjet accounts that have nothing to do together: export the template as a MJML file and reimport it in the new account (you'll be able to edit it in MJML or drag-and-drop). See doc

TeamCity: How to show Nunit3 file attachments in TeamCity test results?

NUnit3 recently added a functionality to add attachments to test results using TestContext.AddTestAttachment(). This adds a url\filelink of the file in results. I can see the entry in Test Result XML generated by console runner.
But I do not see the attachment link on Teamcity. How can I force teamcity to display the file links added as attachment.
To my knowledge, TeamCity haven't yet implemented any functionality to display test attachments.
You should make a feature request for that, here. You could add to your case by pointing out that VSTS does display these file attachments. ;-)

Can Jenkins send more than one email?

After the build I want to trigger two e-mails.
The first one is an email to SharePoint server. SharePoint uploads its attachments. The subject of this mail must match a SharePoint folder for uploading.
The second one is a mail for team. So, it should have nice subject rather than folder name.
How can I make Jenkins send two emails?
There is no plugin that provides this functionality. You have two choices to accomplish this functionality. You could implement your own plugin. A good place to start would probably be the email-ext plugin.
Alternatively, you could trigger the first email with the actual build and then have Jenkins trigger a separate, dummy build that sends the second email. This wouldn't be as elegant, but much easier as you wouldn't need to implement any functionality yourself. Depending on what exactly you want the emails to contain, you might have to transfer some data from the first to the second build (e.g. via a parameterized build).
A cheap alternative is to create "shell script" Build steps, e.g.: (if on *nix platforms)
echo "Please Mr. SharePoint, would you be so kind to attach my file(s) ?
Thanks!" | mail -s "<folder name>" -a ${WORKSPACE}/target/artifacts/myfile sharepoint#example.com
You can also add a new trigger and have the option to send a new email with new content to the recipient list.

Can Jenkins send email taking recepients from a checked out file?

I'm quite a new to Jenkins and I'm stuck trying to configure Jenkins to send email based on a file from checked out files.
Basically, I'm checking possibility to migrate our own build system scripts to run under Jenkins. One of the existing requirements is storing project maintainers' emails in a txt file in the repository. Out of the box Jenkins couldn't do that, perhaps some plugin can do the trick?
It would be great if somehow Jenkins (maybe through some plugin?) could send emails based on the information from checked out copy of repository.
Any help, information or a direction of search would be greatly appreciated.
Maybe with the Email Ext plugin which allows you to configure many many things about email :
Triggers - Select the conditions that should cause an email notification to be sent.
Content - Specify the content of each triggered email's subject and body.
Recipients - Specify who should receive a email when it is triggered.
I didn't find the option to directly take the recipient list from a source file, but you can extend easliy this plugin with Groovy or Jelly scripts.

ccnet email permalink to build

Is there a way to make ccnet's email publisher (or another publisher that sends emails) include a permalink to the actual build that it refers to?
I actually want to be able to link to the unit test results report, so I also need to be able to customise it a bit too, but a link to the build report of the actual build would be a good start.
I'm not sure how you would include the link to the build report but you can include the build report (or parts of it, e.g. unit test results) directly in the email. Just like in the dashboard you can format the output using xsl transformations specified in ccservice.exe.config.