How to use the saveOutput option of emailext plugin in a pipeline

186 views
Skip to first unread message

Oxygen

unread,
Mar 27, 2019, 6:27:20 AM3/27/19
to Jenkins Users
Hi,

The emailext plugin has a option saveOutput  to save the email body to a file, I want to use this plugin with this option in a pipeline, what is the parameter name passed to the call in a pipeline? I tried the following call, but it didn't work, no file is saved under the workspace.

emailext body: '${SCRIPT, template="pipeline_summary.template"}', mimeType: 'text/html', replyTo: 'no-r...@test.com', subject: '${DEFAULT_SUBJECT}', saveOutput: true, to: 'te...@test.com'

Thanks.

Victor Martinez

unread,
Mar 27, 2019, 8:15:30 AM3/27/19
to Jenkins Users
It should be stored in the root path of the workspace, according to the docs: https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/webapp/help/projectConfig/saveOutput.html#L3

The name of the file would be <trigger>-<buildId>.html, further details about the implementation:

Did you use the above snippet within the node section?

If it doesn't work you might need to add some loggers to validate what's going on. https://wiki.jenkins.io/display/JENKINS/Logging likely the name of the class to debug is: hudson.plugins.emailext.ExtendedEmailPublisher





Jinlxz Liu

unread,
Mar 28, 2019, 2:46:27 AM3/28/19
to jenkins...@googlegroups.com
Hi Victor,

I checked the workspace after the pipeline job was executed, but there was no html file under it.

I added some loggers to capture the logs of emailext plugin and executed the plugin again, I received the email, but no output was captured for the logger, the configuration is as follows:

image.png

image.png
the output of the logger is empty after I ran the pipeline.
image.png

Besides the emailext plugin provide the "Save to Workspac" option in a freestyle job, but in Snippet Generator of pipeline syntax it doesn't provide the option, is it possible to use this option in a pipeline syntax? How can I figure out the list of parameter names accepted by a plugin in pipeline syntax?

Thanks.



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/47f8f443-3950-4aaf-9b14-ed16ab87eacd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Victor Martinez

unread,
Mar 28, 2019, 5:48:49 AM3/28/19
to Jenkins Users
You are right! I took the wrong path to search for the code but without reading the specific code for the pipeline itself. So it's not supported I'm afraid! Sorry If I mislead you

Victor Martinez

unread,
Mar 28, 2019, 8:05:44 AM3/28/19
to Jenkins Users

Jinlxz Liu

unread,
Mar 28, 2019, 9:16:17 AM3/28/19
to jenkins...@googlegroups.com
Thank you, Victor

On Thursday, March 28, 2019, Victor Martinez <victormar...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d363da3b-7002-4431-8e56-5061d321b9d9%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages