Problem with CC-ing multiple individuals in email

I have an email notification that I want to sent out. I have a primary recipient and a list of users to CC. The CC portion is split into 2, a group who is always CCed, and a list of additional users that I want to add.

The problem is that the email doesn't go out to the CCed recipients. It only goes out to the main recipient. The CC only works either if I only use the group, or if I only use the process variable with the additional recipients, but never with both. I've tried multiple ways but can't get it to work. I followed the example provided on this thread but didn't work for me. https://community.appian.com/discussions/f/process/6178/send-email-to-multiple-recipients

Here are the things I've tried

{a!forEach(        items: a!groupMembers(cons!PIX_GRP_CFAM_NOTIFICATIONS),expression: user(fv!item, "email")      )&";"& pv!additionalContacts}


{a!forEach(        items: a!groupMembers(cons!PIX_GRP_CFAM_NOTIFICATIONS),expression: fv!item      )&";"& pv!additionalContacts}


{cons!PIX_GRP_CFAM_NOTIFICATIONS &";"& pv!additionalContacts}


{a!forEach(        items: a!groupMembers(cons!PIX_GRP_CFAM_NOTIFICATIONS),expression: toemailrecipient(fv!item)      )&";"& pv!additionalContacts}

None of the above options seem to work and I'm out of ideas. It seems that combining the group with the list of users from the pv! doesn't work. There are no errors, but the email doesn't go out to CC.

  Discussion posts and replies are publicly visible

Parents
  • It seems I found a solution. Instead of using ";" I put everything in curly brackets and separated the group and pv with commas and that seems to work fine

     {pv!additionalContacts, a!forEach(        items: a!groupMembers(cons!PIX_GRP_CFAM_NOTIFICATIONS),        expression:     fv!item        		)}

  • 0
    Certified Lead Developer
    in reply to Jose H.

    I'm unclear why you would've concatenated in a literal ";" character when trying to assemble an array, as this is not a valid character for an email address (and also, this would tend to cause previously-valid arrays to be cast down to a single string IIRC).

    In general, I'd suggest creating a helper expression rule where the output will be an array of email address objects (the final stage should be wrapping the output text email addresses in the "toemailaddress()" function to convert their type, since the Send Email node weirdly cares about this part).  This makes it far easier to test than blindly trying the Send Email node and having it fail for reasons that are hard to discern.

Reply
  • 0
    Certified Lead Developer
    in reply to Jose H.

    I'm unclear why you would've concatenated in a literal ";" character when trying to assemble an array, as this is not a valid character for an email address (and also, this would tend to cause previously-valid arrays to be cast down to a single string IIRC).

    In general, I'd suggest creating a helper expression rule where the output will be an array of email address objects (the final stage should be wrapping the output text email addresses in the "toemailaddress()" function to convert their type, since the Send Email node weirdly cares about this part).  This makes it far easier to test than blindly trying the Send Email node and having it fail for reasons that are hard to discern.

Children
No Data