Multiple value in cc giving error in response body

Brijmohan
Tera Contributor

I have configured outbound email integration through outbound rest message. I am facing one issue here when I am passing 1 email id in cc it is working fine and receiving email but when I am giving two mail id in cc it is not working and giving below error.

At least one recipient is not valid., Recipient 'brijmohan.kushwaha@test.com,vipul.agnihotri@test.com' is not resolved. All recipients must be resolved before a message can be submitted."}}

 

I am assuming there is issue with JSON structure in BR (sys_email table). How can I handle multiple id in cc. PFB code.

var body = current.body_text;
var subject = current.subject;


var restMessage = new sn_ws.RESTMessageV2('Email PoC', 'POST Email User');

// Set the request body
var requestBody = {

  "message": {
    "subject": current.getValue('subject'),
    "body": {
      "contentType": "html",
      "content": current.getValue('body')
    },
    "toRecipients": [
      {
        "emailAddress": {
          "address": current.getValue('direct')
        }
      }
    ],
    "ccRecipients": [
      {
        "emailAddress": {
          "address": current.getValue('copied')

        }
      }
    ]
  },
  "saveToSentItems": "true"
};

gs.info("test 3 "+requestBody +JSON.stringify(requestBody));
restMessage.setRequestBody(JSON.stringify(requestBody));
//restMessage.setRequestBody((requestBody));
// Send the REST message

gs.info("test 4 "+restMessage);
var response = restMessage.execute();

// Get the response details
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();

gs.info("test 1 "+responseBody);
gs.info("test 2 "+httpStatus);

 We are getting below in response body.

Brijmohan_0-1693829564194.png

 

Thanks & regards,

Brijmohan

 

5 REPLIES 5

Hi @Brijmohan 

The code you are providing is something which calls rest message, I wanted to take a look at your rest message if it is configured properly.
One more hint, your screenshot shows email ids are separated by ',' / 'comma', can you please try to separate them with ';' / 'semicolon'. 

If you need further assistance please feel free to DM me.