Is this the correct forum for my enquiry???
I am trying to forward emails arriving into an architect email flow automatically based on key word found in the subject or body of email. These are auto forwarded outside of Genesys to the correct teams shared MS mailbox address using an Agentless data action without an agent being involved.
2 snags:-
[A] - the call data action "agentless email" fails in the flow on the html body of email
[B] I am unable to FWD attachments (apparently this is a limitation of the system at present)
The Agentless email data action variable "Email.Message.htmlBody" is where it falls down. The email sends ok if I do not include the body of the email.
Obviously there is a formatting issue with the way the htmlbody is interpreted by the data action.
Does anyone know how to get more than 1 filter in the data action email body as i believe my issue is syntax???
e.g Any one of these 3 work individually. How does one combine them all into 1 piece of code???? or provide a better piece of code for me to try :)
Replace(Email.Message.htmlbody, ",", "<br>")
Replace(Email.Message.htmlbody, "\R", "<br>")
Replace(Email.Message.htmlbody, "\N", "<br>")
Some suggest having the Data action requestTemplate remove any newlines (\n or \r) from the string AND escape the newlines so they don't cause an issue. How does one do all of this in the one request template??
I have tried this but it doesn't work
{
"senderType": "Outbound",
"fromAddress": {
"email": "${input.fromAddressEmail}",
"name": "${input.fromAddressName}"
},
"toAddresses": [
{
"email": "${input.toAddressEmail}",
"name": "${input.toAddressName}"
}
],
"replyToAddress": {
"email": "${input.replyToAddressEmail}",
"name": "${input.replyToAddressName}"
},
"subject": "${input.subject}",
"htmlbody": "{\"input.htmlBody\" : #if( ${input.htmlBody} && ${input.htmlBody} != \"\")\"$esc.html(${input.htmlBody.replace("\n", "\\\n").replace("\r", "\\\r")})\"#{else}null#end}"
}
ERRORS
{
"message": "The request could not be understood by the server due to malformed syntax.",
"code": "bad.request",
"status": 400,
"messageParams": {},
"contextId": "56cd6c0d-2a42-453b-a0c0-92754638e5cd",
"details": [
{
"errorCode": "ACTION.PROCESSING"
}
],
"errors": [
{
"message": "Action failed validation. Errors: [Template validation failed for 'config.request.requestTemplate'. Details: Lexical error, Encountered: \"\\\"\" (34), after : \"\\\\\" at *unset*[line 18, column 88]]",
"code": "BAD_REQUEST",
"status": 400,
"messageParams": {},
"details": [],
"errors": []
}
]
}
#ArchitectureandDesign
#DataActions
#Agentless
#EmailFlow
------------------------------
Simon Mckenzie
Genesys Cloud Technical Consultant
------------------------------