Clarity

Expand all | Collapse all

CA PPM SaaS Gel email file attachment

  • 1.  CA PPM SaaS Gel email file attachment

    Posted Mar 09, 2016 03:52 PM

    I have a GEL script that creates a file and places it on my file share area {fs0/clarity1/share/foo.csv}.

    I have found the basic code for sending an email in the gel script:

      <gel:email from="username@mailserver.com"

      fromName="Clarity Admin"

      to="user@somedomain "

      subject="Simple email">

      Hello World.

      </gel:email>

    But I can't seem to find any info about attaching the file I made - or even if that is possible in a SaaS

    environment.

    Thanks!!!



  • 2.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 09, 2016 06:15 PM

    You will need to use the Jelly:email tag which supports a single attachment.

     

    Email Tag Library - Tag Documentation

     

    You also can use the core:new / core:invokeStatic to use native Java classes for sending email.

     

    This post shows how to add any number of attachements via adding MimeMultiparts to an mail message.

     

    Can we sent Meeting Invite from Clarity?

     

    V/r,

    Gene



  • 3.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 10, 2016 08:54 AM

    Thank you. I altered my script to be this:

    <gel:script
      xmlns:core="jelly:core"
    xmlns:util="jelly:util"
      xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
    xmlns:file="jelly:com.niku.union.gel.FileTagLibrary"
    xmlns:mail="jelly:email" >

      <gel:email from="username@mailserver.com"
      fromName="Clarity Admin"
      to="jsnider@aflac.com"
      subject="Simple email"
      attach="/fs0/clarity1/share/tc_fgaflac_03092016.csv">
      Hello World.
      </gel:email>
      
    </gel:script>

    and now in the process screen, I get this error:

    BPM-0703: Custom script syntax error at line 12, column 56: Tag 'email' does not have attribute 'attach'.

     

     

    Although the jelly web page says it is ok. What am I missing?

     

     

     

    THanks!!  - Joanne



  • 4.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 10, 2016 08:58 AM

    You are still using the <gel:email> method though!



  • 5.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 10, 2016 01:37 PM

    Replace the gel:email with jelly:email as pointed out by Dave.  The jelly:email tag doesn't have support for the fromName.

     

     

    <gel:script
    xmlns:core="jelly:core"
    xmlns:util="jelly:util"
    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
    xmlns:file="jelly:com.niku.union.gel.FileTagLibrary"
    xmlns:mail="jelly:email" >
    
    <jelly:email 
    from="username@mailserver.com"
    to="jsnider@aflac.com"
    subject="Simple email"
    attach="/fs0/clarity1/share/tc_fgaflac_03092016.csv">
    Hello World.
    </jelly:email>
    
    </gel:script>
    

     

    V/r,

    Gene



  • 6.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 10, 2016 04:02 PM

    Thank you, Gene,

    When I used your code above, I got a different error:

    BPM-0703: Custom script syntax error at line 12, column 54: The prefix "jelly" for element "jelly:email" is not bound.

    Is this one of those things, like FTP, that just won't work in On Demand?

    Thanks!! - Joanne



  • 7.  Re: CA PPM SaaS Gel email file attachment
    Best Answer

    Posted Mar 10, 2016 04:54 PM

    Sorry, I didn't use the correct namespace prefix -- it should have been mail not jelly.

     

    <gel:script
    xmlns:core="jelly:core"
    xmlns:util="jelly:util"
    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
    xmlns:file="jelly:com.niku.union.gel.FileTagLibrary"
    xmlns:mail="jelly:email" >
    
    <core:invokeStatic var="v_config" className="com.niku.union.config.ConfigurationManager" method="getInstance" />
    <core:set var="mailHost" value="${v_config.getProperties().getMailServer().getHost()}" />
    
    <gel:log>${mailHost}</gel:log>
    
    <mail:email 
      from="ggreiff@ggreiff.com"
      to="gcubed@ggreiff.com"
      subject="Simple email"
      server="${mailHost}"
    >
    Hello World.
    </mail:email>
    
    </gel:script>
    

     

    So I just tested this in our On Demand environment.  The jelly:email tag needed the mail server name so I added code to pull it from the properties.

     

    So I ran it on our development instance and it didn't work -- Our development instance doesn't have an email server setup on it.  On our production instance it worked.

     

     

     

    V/r,

    Gene



  • 8.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 11, 2016 08:21 AM

    Thank you!!! It worked here too.



  • 9.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 17, 2016 12:17 PM

    Are you able to send emails with attachments in on-demand setup now?



  • 10.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 17, 2016 01:38 PM

    So I ran my test you see above on our production system which is an On Demand system.

     

     

    V/r,

    Gene



  • 11.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 17, 2016 01:47 PM

    It requires some GEL tag calls that shouldn't be used in OD environments (but without which, currently could not do what you want to do).

     

    The following was created to improve this in a way that would work and be supported in all deployments: GEL email tag supporting attachments and CC without requiring smtp hostname



  • 12.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 18, 2016 09:20 AM

    Nick,

     

    Is there a generic smtp host that could be used within the OD environment?

     

    If so this would work without using the com.niku.union.config.ConfigurationManager class.

     

    V/r,

    Gene



  • 13.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 18, 2016 09:45 AM

    I'm sorry but there isn't - it's an item of internal infrastructure and there won't be any intention of making it an external piece of information.

     

    The way forward will be modifying the GEL tag libraries to include the support for those features.  Until then, running unsupported code to obtain / supply a hostname would be the only way (for as long as that works, as it can break when our code changes too since it is also internal and not an API).



  • 14.  Re: CA PPM SaaS Gel email file attachment

    Posted Mar 17, 2016 02:03 PM

    Yes, when I said "Thank you!!! It worked here too." I meant that I tried the method that was specified and it worked fine. I am now able to send a single email attachment now.

     

    Thanks!!  - Joanne