0

In sitecore CDP ,I have created connection for send email. this connection is triggerd but status is error. can anyone suggest me the way to run this email trigger successfully? enter image description here

My request is

{
  "Messages": [
    {
      "From": {
        "Email": "[email protected]",
        "Name": "mymail"
      },
      "To": [
        {
          "Email": "[email protected]",
          "Name": "mymail"
        }
      ],
      "Subject": "My first Mailjet Email!",
      "TextPart": "Greetings from Mailjet!",
      "HTMLPart": "<h3>Dear passenger 1, welcome to <a href=\"https://www.mailjet.com/\">Mailjet</a>!</h3><br />May the delivery force be with you!"
    }
  ]
}

Here is my response of this email trigger

"responsePayload": {
      "headers": "null",
      "body": "{\"body\":\"{\\n  \\\"statusCode\\\" : 400,\\n  \\\"reason\\\" : \\\"Bad Request\\\",\\n  \\\"responseBody\\\" : {\\n    \\\"ErrorIdentifier\\\" : \\\"f36854a5-0199-40c8-945b-dda96dd9c3fd\\\",\\n    \\\"ErrorCode\\\" : \\\"mj-0003\\\",\\n    \\\"StatusCode\\\" : 400,\\n    \\\"ErrorMessage\\\" : \\\"Missing mandatory property.\\\",\\n    \\\"ErrorRelatedTo\\\" : [ \\\"Messages\\\" ]\\n  },\\n  \\\"url\\\" : \\\"https://api.mailjet.com/v3.1/send\\\"\\n}\"}",
      "statusCode": null
    },
    "statusCode": 400,
    "errorData": "{\n  \"statusCode\" : 400,\n  \"reason\" : \"Bad Request\",\n  \"responseBody\" : {\n    \"ErrorIdentifier\" : \"f36854a5-0199-40c8-945b-dda96dd9c3fd\",\n    \"ErrorCode\" : \"mj-0003\",\n    \"StatusCode\" : 400,\n    \"ErrorMessage\" : \"Missing mandatory property.\",\n    \"ErrorRelatedTo\" : [ \"Messages\" ]\n  },\n  \"url\" : \"https://api.mailjet.com/v3.1/send\"\n}",
    "executionTimeMs": 104,
    "connectionUrl": "https://api.mailjet.com/v3.1/send",
    "mappingResult": null
5
  • Could you provide error details from Experience Execution (when you click "View Experience Execution")?
    – x3mxray
    Commented Jan 11, 2022 at 18:12
  • Hi @x3mxray ,Thankyou for your response .I have added the error response in question .please check it.
    – Nithya
    Commented Jan 12, 2022 at 4:47
  • I found your experience in Partner Sandbox, and as I see you have incorrect syntax in API response in Freemarker (in line 3 you have "{ <#-- Freemarker will go here --> }" that duplicates "{..}"). So just delete line 3 and leave only "{ "Messages": [...] }".
    – x3mxray
    Commented Jan 12, 2022 at 11:24
  • hi @x3mxray, I have mentioned my request in the question. when I try to test the request from the connection, the test result is "statuscode:200".but when I try to run this with the experience it failed to trigger.as per your response in the comment ,exactly in which place I need to remove this "{}".
    – Nithya
    Commented Jan 18, 2022 at 8:58
  • see an image in aswer below.
    – x3mxray
    Commented Jan 18, 2022 at 10:13

1 Answer 1

1

I found your experience in Partner Sandbox, and as I see you have incorrect syntax in API response in Freemarker (in line 3 you have "{ <#-- Freemarker will go here --> }" that duplicates "{..}"). So just delete line 3:

1. <#-- Construct the API response using Freemarker -->
2. <#-- For your Experience to run your API tab must have, at a minimum, open and closing brackets -->
3. {  <#-- Freemarker will go here -->   } // DELETE this line
4.
5.{
6.      "Messages":[
7.              {
8.                      "From": {
9.                              "Email": "[email protected]",
10.                             "Name": "Test user"
11.                     },
12.                     "To": [
13.                             {
14.                                     "Email": "[email protected]",
15.                                     "Name": "test receiver"
16.                             }
17.                     ],
18.                     "Subject": "My first Mailjet Email!",
19.                     "TextPart": "Greetings from Mailjet!",
20.                     "HTMLPart": "<h3>Dear passenger 1, welcome to <a href=\"https://www.mailjet.com/\">Mailjet</a>!</h3><br />May the delivery force be with you!"
21.             }
22.     ]
23.     }

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.