Jenkins Email-ext plugin - tokens - jenkins

Hi I'm using Jenkins Email-ext plugin.
Where can I find a list of all the things I can refer to in the html content of the email?
For instance: I recently found out that you can put parameters values inside the mail using:
${ENV,var="variable_name"}
But say that I want to get build log or build number or build status (passed fail).
Do you know if there is a document listing all data that is referable in this plugin.
Thanks!!

On job configurations page:
Check 'Editable Email Notification' box -> find 'Content Token Reference' (it's between 'Attachments' and 'Trigger for matrix projects') -> Click on ? to the right side of it.

Related

how to use emailext-template in jenkins pipeline to get the template?

There is a good plugin, emailext-template. Basically, I do not have the access to Jenkins-server. It is not convenient to choose the option mentioned in emailext to create the email template.
I dont know how to use this emailext-template plugin to get the template in jenkins-pipeline. There is no guideline in emailext-template. Any documents?
// expected usage in jenkins-pipeline
template_str = emailext-template('template-id')
This can be done in the following way, In case you can deploy jenkins again (if it is done on the cloud), you could create and deploy your email template as part of jenkins installation and configuration.
In case you did not have access to the jenkins server even while deployment, you can just form the html template with the corresponding variables and then use them in the job configuration itself.
The below image shows how the template files are used in jenkins, Instead of the script tag as in the image, you can replace with your own html content so that jenkins will be able to send email with that content.

Sending robot framework log file as email content via Jenkins is not getting displayed

I have created a Jenkins job to execute robot framework. The results[log.html and report.html] of the Jenkins are getting displayed properly.
Now I am using the email-ext plugin to send the log file as email content to the specified group of users, but the received email doesn't display the content and shows error as "Opening Robot Framework log failed" in the email.
I have set the email-ext plugin as follows:
I wish to send the robot results as email content, not as an attachment, I have tried various methods like Linux, shell scripting etc, but still, it doesn't work. How can the log.html email content can be sent to the email body?
You will not be able to just put the entire content of the robot log.html in an email because it contains javascript.
I've been looking into this the last few days as well and have come to see that using a groovy based template using the jenkins Email-ext plugin is the way to go. Googling for 'jenkins robot framework email template' shows a few hits and one that I'm planning to try and then modify to my liking was this one:
https://github.com/vladwa/robot-email-template
From this I found that we don't have access to all of the test info built in, so I wrote up some modifications to load the robot output.xml as an artifact to then be able to inject any data in that file into the html email report. Here's the gist of that:
https://gist.github.com/harbdog/070f0be66ebae343d6d11e57a6c6fc08
Here's what it looks like for example:
You have to configure publish robot framework test result <post build> and then use {ROBOT_REPORTLINK} in email content section

Email Reports through Jenkins

I have a pdf generated by Dynamic Reports.I want to add this pdf as an attachment in the mail feature of Jenkins for each and every build of the project.Is It possible to achieve this.Is there any another way in which I can mail my reports through Jenkins.
Use Email-ext plugin for Jenkins. It provides more configuration options than "standard Jenkins" emails. Also it gives you opportunity add attachments to your emails:
Attachments
New to version 2.15 is the ability to add attachments using the Ant pattern matching syntax used in many places in Jenkins. You can set a maximum total attachment size in the global configuration page, or it will be unlimited.

Jenkins/hudson email-ext plugin - "committers" option not visible

I'm trying to use the Jenkins email-ext plugin (Editable Email Notification) to notify a committer if they've broken a build.
This can apparently be done by adding a post build action to a project, choosing "Editable Email Notification", and then selecting a committers checkbox.... but I can't seem to find this checkbox!
If you look at my screenshot below you can see that there is no option for just committers, and I can only see "Recipient list", "Developers", or "Requestor", and only when I add an extra trigger.
Does anyone have any suggestions as to how to get this option? Am I missing another plugin that is required (I've got the Subversion Plug-in) or something?
Email ext plugin is v2.32 (the latest) and Jenkins is v1.528 (nearly the latest).
There is no option as "committers" we have only the option to chose between developers or to opt for a trigger for success or failure to a requestors or to list of people in the recipients list

How to have output of script emailed from Jenkins?

I am setting up a Jenkins job that processes some data.
Once the job is finished, I would like to have jenkins run a script that describes the status of the recent processing and email the stdout of that script to a specified email address.
While I realize that it is possible to have the script send the email itself, I am wondering if there exists a more ideal way to have Jenkins send the output of that script. Is there a plugin that is idea for this?
Thanks.
To configure the Email-ext plugin:
To get a portion of the log in the mail, if not all, set the 'Extended E-mail Notification' to send an email for each build that failed, and use the $BUILD_LOG in the body of the message:
In the body of the message (below the '$DEFAULT_CONTENT' ) add the parameter $BUILD_LOG to display the end of the build log
Assuming the log is in plain-text, change 'Content Type' to Plain Text
For the list of built-in Jenkins parameters, go to this page:
http://[your-jenkins-server]/env-vars.html
Cheers
EDIT:
To get to that list of available env-vars via the UI,
there is a link at the Execute shell build-step, for example -
I'm not sure if this is exactly what you're looking for, but the Email-ext plugin for Jenkins sounds like it may do what you want.

Resources