I'm trying to use Dotmailer's external dynamic content to render dynamic content for an email from sfdc data
I initally almost had this working using a visualforce page exposed in a force.com site, but the vf page includes javascript in the headers, that I was unable to remove, which caused rendering issues in a small number of cases.
Dotmailer support indicates that the expected response is a html page. So I'm trying to use an apex REST endpoint to return a HTML page. I've set one up here, which is set to return a string as a response. The string is not rendered in the email, as the page is returning xml.
I'm probably missing something basic as my background knowledge on how http requests work is limited, but any suggestions on how to address this are appreciated. The rather elementary code for my endpoint is below:
@RestResource(urlMapping='/Applications/*')
global with sharing class applicationEndpoint {
@HttpGet
global static string GetTitle() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
res.addHeader('Content-type', 'text/html; charset=utf-8');
String resp = 'session title';
return resp;
}
}