ticket = invokeurl
[
type :GET
connection: "{name}"
];
template = invokeurl
[
type :POST
connection: "{name}"
];
surveyLinkElement = "{url}" + ticketId + "&a=" + agentId;
surveyLinkElement = '<a href="'+surveyLinkElement+'">Link</a>';
templateBody = template.get("body").replaceAll("[#surveyLink#]", surveyLinkElement, true);
params = Map();
params.put("content",templateBody);
params.put("contentType", "html");
params.put("fromEmailAddress", "{name}");
params.put("to", "{name}");
params.put("channel","EMAIL");
headerData = Map();
headerData.put("Content-Type", "application/json");
sendReply = invokeurl
[
type :POST
parameters: params.toString()
headers: headerData
connection: "zohodesk"
];
info sendReply;