Using SilverStripe 4.12
I have a ContactPage and it has an AJAX form on there that sends emails. In my ContactPage_Controller I have the email template generated like this:
$emailBody = $this->customise([ 'Layout' => $this->customise($templateData)->renderWith(['MyModule\Layout\Contact_Email'])])->renderWith(['Email']);
I’m a bit clueless as to exclude the script from the email template rendering.