Array of Email addresses in Email Template To: field

Hello,

I'm having issues trying to get an array of email addresses to work in the Email Template To: field. I'm using Appworks 23.4 version. This was working in AppWorks 22.4.

In the documentation, it details how you can use toString() to delimit values in an array.

For instance:

{item.RequestApproval.FYIUser[].GuestUser.toPerson.Properties.Email.toString(';')}

However when I do that, I get error below. Does anyone know the correct way to add email addresses from an array in the email template? Thanks much for any assistance!

_______________________________________________________________________________________

The format of the email address is not correct.</faultstring><faultactor>http://schemas/CCMS/ContentRequest</faultactor><detail><cordys:FaultDetails xmlns:cordys="http://schemas.cordys.com/General/1.0/"><cordys:LocalizableMessage><cordys:MessageCode>Cordys.ApplicationServerPackage.Messages.executionException</cordys:MessageCode><cordys:Insertion>jakarta.ejb.EJBTransactionRolledbackException: The transaction has been marked rollback only because the bean encountered a non-application exception :jakarta.xml.ws.WebServiceException : The format of the email address is not correct.</cordys:Insertion></cordys:LocalizableMessage></cordys:FaultDetails><cordys:FaultRelatedException xmlns:cordys="http://schemas.cordys.com/General/1.0/"><![CDATA[jakarta.ejb.EJBTransactionRolledbackException: The transaction has been marked rollback only because the bean encountered a non-application exception :jakarta.xml.ws.WebServiceException : The format of the email address is not correct.

Comments

  • AppWorks Tips
    AppWorks Tips Member
    edited August 13 #2

    @Lori Dingman

    Have a close look at the examples in this post:

    If it's still not working, I try out your example myself; In that case, it would be great to have a small example project where you can reproduce the use case.

    //Antal

  • Hello Antal,

    Thanks for your help. I've been to your helpful site before.

    I tried {(item.RequestApproval.FYIUser[].GuestUser.toPerson.Properties.Email).split(';')}

    in the To: field. I keep getting this error:

    [CDATA[jakarta.ejb.EJBTransactionRolledbackException: The transaction has been marked rollback only because the bean encountered a non-application exception :jakarta.xml.ws.WebServiceException : The format of the email address is not correct.

    Here's a screen shot of the form which lives in Request Approval entity. You can see the path of the email, which displays to end user correctly. But when I call it in the email template, errors. I'll try to create a small project with the same structure. Thank you for looking at this.

    The other thing I notice since upgrading to 23.4 is that the body of the email template no longer has the expression editor available. (see Pict below)

  • nssmani
    nssmani E Community Moderator

    @Lori Dingman , The expression you are using should work unless there is some issue in the email of the users. Can you create a rule and see the list of email that are populated using the below expression?

    {item.RequestApproval.FYIUser[].GuestUser.toPerson.Properties.Email.toString(';')}

  • AppWorks Tips
    AppWorks Tips Member
    edited August 19 #5

    @nssmani and @Lori Dingman

    Looks to me like you need extra parentheses:

    {(item.RequestApproval.FYIUser[].GuestUser.toPerson.Properties.Email).toString(';')}

    At least this is what I see in my sample project:

    {User.toPerson.ToAssignment[0].Identity.ItemId} //Gives the first item
    {User.toPerson.ToAssignment[1].Identity.ItemId} //Gives the second
    {(User.toPerson.ToAssignment[].Identity.ItemId).size()} //Gives the length
    {(User.toPerson.ToAssignment[].Identity.ItemId).toString(';')} //Concats them all with ';' in between…
    {(User.toPerson.ToAssignment[].Identity.ItemId).contains('F8B156B4FF8F11E6EB2FFEEDADE25F8A.65537')} //Gives a TRUE in my case

    It's GREAT stuff, but unclear in the low-code documentation! The String methods section does not even mention this toString(';') function!?

    Let me post about it on appworks-tips.com 😉

    //Antal

  • A rectification as it's documented:

    //Antal