Merge pull request #612 from creative-commoners/pulls/4.2/fix-email-template-rendering

Update UserFormRecipientItemRequest::preview to use theme-templates
This commit is contained in:
Franco Springveldt 2017-06-16 11:39:02 +12:00 committed by GitHub
commit 630c5c3395
1 changed files with 9 additions and 1 deletions

View File

@ -20,11 +20,19 @@ class UserFormRecipientItemRequest extends GridFieldDetailForm_ItemRequest
*/
public function preview()
{
return $this->customise(new ArrayData(array(
// Enable theme for preview (may be needed for Shortcodes)
Config::nest();
Config::inst()->update('SSViewer', 'theme_enabled', true);
$content = $this->customise(new ArrayData(array(
'Body' => $this->record->getEmailBodyContent(),
'HideFormData' => $this->record->HideFormData,
'Fields' => $this->getPreviewFieldData()
)))->renderWith($this->record->EmailTemplate);
Config::unnest();
return $content;
}
/**