Clarity

  • 1.  GEL:Email library updates

    Posted Oct 31, 2016 11:36 AM

    I have a situation where I need to use the following components of an email library:

     

    1. HTML

    2. CC/BCC

    3. Attachment

     

    I know that the default gel:library supports 1, but not 2 and 3. And the email:email library supports 2 and 3, but not 1. 

     

    Does anyone know where/how to modify those libraries to include all three?

     

    I see the library/classes in lib/commons-jelly-tags-email.jar, but it includes cc. And when I try to use cc in a gel script, it errors saying that tag is not supported. 

     

    Any help combining/creating this library would be appreciated. It is something I know many clients have been wanting for a long time. 

     

    Thanks. 



  • 2.  Re: GEL:Email library updates

    Posted Oct 31, 2016 02:01 PM

    I'm a big fan of what William_W is doing here with the JavaMail API: How to code an HTML formatted email using GEL script.

     

    JavaMail frees you of any limitations of GEL & Jelly email capability.

     

    I've recently used this approach for an HTML email with CC & BCC. I haven't used Attachments but Google yields many examples - probably a couple here in the forums as well.

     

    HTH.



  • 3.  Re: GEL:Email library updates

    Posted Oct 31, 2016 02:26 PM

    Thanks, Robert. 

     

    Yes, this does work. I've found my original thread where I posed this questions awhile ago:

    GEL EMAIL CC 

     

    As you can see, email:email offers some support, gel:email offers the other, but neither library covers ALL. Gene had a good post about the supporting library for email:email. But I have yet to find the location for the gel:email library/any jar/class files. 

     

    The solution you posted is A solution, but rather clunky and way too many lines of code for the number of emails we send in GEL scripts. The gel:email, and even email:email solutions alone are enough formatting, but the added lines to support the java-based approach you listed would take a lot of time to convert. What I am trying to do is find a way to modify the library. 

     

    Sadly, a search Google does not yield the examples I need to merge these two libraries. Hence the post. 

     

    Thanks!



  • 4.  Re: GEL:Email library updates

    Posted Nov 01, 2016 05:22 AM

    So if you are on premise, I would just add a org.apache.commons.jelly.expression.Expression, say HtmlMessage, to the existing jelly email tag that would  setContent method on the MimeMessage object.  You will need logic that doesn't call the setText method if the HtmlMessage expression exists.

     

    Ref:

    EmailTag xref 

    EmailTagLibrary xref 

    java - How do I send an HTML email? - Stack Overflow 

     

    V/r,

    Gene



  • 5.  Re: GEL:Email library updates

    Posted Oct 31, 2016 03:50 PM

    Found the file:

     

    lib/union.jar

    com.niku.union.gel.tags.EmailTag.class

     

    Now to see about combining it with the other class. 



  • 6.  Re: GEL:Email library updates

    Posted Mar 07, 2019 11:09 AM

    hello derrickat

    Did you combine both email classes? how was it ?