• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • email-ext-plugin
    • None
    • Platform: All, OS: All

      We migrated from CruiseControl to Hudson recently and found that it is not able
      to send Rich text email. I checked the Email-Extender plugin but the variables
      provided by it are limiting.

      So I modified the plugin to use Groovy SimpleTemplate to generate the email
      content. A user would set the email content in form of Groovy script through UI.
      To the script the build variable would be exposed as a binding

      Using that one can extract whatever information he is interested in and then
      output it in required form

        1. email-ext-groovy-2011-02-16.patch
          41 kB
        2. email-ext-groovy-2010-10-07.diff
          41 kB
        3. updated_on_2010-05-18.patch
          37 kB
        4. updated_on_2010-05-07.patch
          37 kB
        5. another_fix_2010-02-19.patch
          36 kB
        6. html.br.patch
          1.0 kB
        7. fixed_tests_2010-02-12.patch
          36 kB
        8. subject-template.txt
          0.1 kB
        9. svn-template.html
          6 kB
        10. updated_on_2010-02-12.patch
          31 kB
        11. based_on_2009-09-28.patch
          29 kB
        12. svn-template.html
          6 kB
        13. groovy-email2.patch
          8 kB
        14. groovy-email.patch
          8 kB
        15. html-email.txt
          16 kB

          [JENKINS-2175] Sending Rich text mail with Hudson

          chetan_oct created issue -

          chetan_oct added a comment -

          Created an attachment (id=342)
          The patch for supporting HTML email

          chetan_oct added a comment - Created an attachment (id=342) The patch for supporting HTML email

          chetan_oct added a comment -

          I have attached the patch here. Few points regarding the changes

          – The email plugin would now have a dependency on groovy 1.5.6 in pom.xml

          – I wanted to validate the script content. It would only check that it can be
          compiled or not. But the current mechanism seems like uses GET request. But here
          as the content can be large I would like it to be sent it as POST. The backend
          code is there in ExtendedEmailPublisher.doMailContentCheck. Just need to wire it
          up in UI

          – Would post the example later!!

          chetan_oct added a comment - I have attached the patch here. Few points regarding the changes – The email plugin would now have a dependency on groovy 1.5.6 in pom.xml – I wanted to validate the script content. It would only check that it can be compiled or not. But the current mechanism seems like uses GET request. But here as the content can be large I would like it to be sent it as POST. The backend code is there in ExtendedEmailPublisher.doMailContentCheck. Just need to wire it up in UI – Would post the example later!!

          chetan_oct added a comment -

          chetan_oct added a comment - Added an example at http://techkriti.wordpress.com/2008/08/30/using-groovy-with-hudson-to-send-rich-text-email/

          againjj added a comment -

          Sub-component should be email-ext.

          againjj added a comment - Sub-component should be email-ext.

          Tom Jordan added a comment -

          adding myself to CC list

          Tom Jordan added a comment - adding myself to CC list

          ponns added a comment -

          Hey Chetan,

          I'm trying to use your patch. When copy pasted the test summary related snippet
          to my Default content field, it resulted in a Fatal error by showing the the
          code is missing a "}" at line 49. Later when I fixed the stuff, the Hudson
          console log shows its sending email. But I receive a blank mail.

          ponns added a comment - Hey Chetan, I'm trying to use your patch. When copy pasted the test summary related snippet to my Default content field, it resulted in a Fatal error by showing the the code is missing a "}" at line 49. Later when I fixed the stuff, the Hudson console log shows its sending email. But I receive a blank mail.

          ponns added a comment -

          I take back my comments. I did a partial copy of the Default content. I think
          now I got it working. To me this patch is an excellent one and I recommend this
          to be added as a feature to the email-ext. Its definitely a value-add.

          ponns added a comment - I take back my comments. I did a partial copy of the Default content. I think now I got it working. To me this patch is an excellent one and I recommend this to be added as a feature to the email-ext. Its definitely a value-add.

          narayam added a comment -

          I have been using Chetan's patch for a couple of months now. It has been a huge
          value-add to my project. It has helped provide detailed failure diagnostics in
          the rich text emails to testers. I hope this patch is incorporated.

          narayam added a comment - I have been using Chetan's patch for a couple of months now. It has been a huge value-add to my project. It has helped provide detailed failure diagnostics in the rich text emails to testers. I hope this patch is incorporated.

          mdonohue added a comment -
              • Issue 545 has been marked as a duplicate of this issue. ***

          mdonohue added a comment - Issue 545 has been marked as a duplicate of this issue. ***

            slide_o_mix Alex Earl
            chetan_oct chetan_oct
            Votes:
            42 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated:
              Resolved: