Why are Jenkins "extended emails" not including extended information?
Asked Answered
O

4

13

We installed email-ext 2.24.1 into Jenkins 1.447. We set "Extended Email Notification" "Default Content" to

$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:

Check console output at $BUILD_URL to view the results.

Failed tests (regressions compared to previous builds): ${FAILED_TESTS, onlyRegressions=true}

Changes: ${CHANGES, showPaths=true, format="%a: %r %p \n--\"%m\", pathFormat="\n\t- %p"}

We went to a project, and selected "Editable Email Notification" and left the default settings, where "Default Subject" says $DEFAULT_SUBJECT and "Default Content" says $DEFAULT_CONTENT.

In emails that come out, it's as if email-ext doesn't exist. I just see build information, nothing about the tests that failed or the changes since last success.

Why do the emails not show Failed tests and Changes? And how do I debug this? Are there logs somewhere showing what is getting run?

Edit: I added "HALLOO" to the project "Default Content". Didn't show up.

Screenshot of the email portion of the global configuration: global config

Screenshot of the email portion of the job configuration page: job config

Onitaonlooker answered 5/10, 2012 at 14:26 Comment(4)
Can you post a screen shot of the job configuration page?Afterbirth
Do you mean the Email Notification portion, or the whole thing? I'll attach the Email Notification portion.Onitaonlooker
Hey @Onitaonlooker , from where you got the parameters to be used? eg: $FAILED_TESTS ?Portmanteau
I have no idea, it was four years ago. Sorry.Onitaonlooker
B
6

In the Post build actions section, delete the E-mail notification altogether. This will ensure your instance is using only Editable email notification

This is possible in my version (1.477), not sure when this function of adding/deleting post-build actions released.

Badminton answered 8/10, 2012 at 8:4 Comment(3)
Thanks for this suggestion. I upgraded to Jenkins 1.484, deleted "E-mail notification" from the project config. The only post-build actions are now "Publish Junit test result report" and "Editable Email Notification". I get no email. When I look in the log, it says the build succeeded, but it doesn't appear to be logging anything about email-ext.Onitaonlooker
@Onitaonlooker hmm.. once I upgraded Jenkins long back and my emails stopped altogether. Then I removed the email plugin and installed again.. it worked. Try this option if possible.Badminton
One project sometimes seems to send the email-ext notifications, don't know under what circumstances. I gave up trying to get it to do the right thing. Our plan (when we have time) is to write our own scripts to use the Jenkins API to pull the data we want. Thanks for your help, but .. no, it didn't. :/Onitaonlooker
A
2

You need to un-check the box for default email notifications and then add your recipients list to the extended email configuration. Using the $DEFAULT_RECIPIENTS will only work if you have configured defaults.

Afterbirth answered 5/10, 2012 at 21:11 Comment(3)
On the job page, I tried unchecking "E-mail notification" and putting my email address in "Project Recipient List", then hitting "Build Now". Is that what you meant? No email. Is there a log I can look at where I can see what it is trying to do?Onitaonlooker
Alternatively, can you post a screenshot of a working screen? Maybe I can copy it.Onitaonlooker
You could try hitting the "Advanced" button and adding a specific trigger, but this should work with default settings if the regular notifications are sending. I will see about getting you a screenshot, but I doubt it's going to help in this case.Afterbirth
M
2

There are several issues. First, you need to add a default recipient in the global config screen. The per job configuration is broken. The author claims it should not appear anymore, but it still does in the latest version.

Second, you should try specifying the content in the per job box. Delete the $DEFAULT_CONTENT and replace it with your template.

In my install, I was able to get it to work by doing that. I also had to hit advanced (in the per job config) and explicitly set triggers before it would send me email.

I've had trouble getting unit test failures to print, but CHANGES works.

Meaghanmeagher answered 14/12, 2012 at 21:53 Comment(0)
C
1

In the job configuration page, go to the Editable Email Notification section. At the bottom of this section you can add triggers via a dropdown box you get after you've clicked on the Advanced... button. When I first configured the email notifications, there was no trigger defined, and no email was sent out.

If you always want an email sent out, use the Before build trigger. Then add a checkbox to determine the recipients of the email for this trigger. If you want all email addresses in $DEFAULT_RECIPIENTS, then click the checkbox at Send To Recipient List.

Clift answered 29/3, 2013 at 22:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.