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

View File

@ -20,11 +20,19 @@ class UserFormRecipientItemRequest extends GridFieldDetailForm_ItemRequest
*/ */
public function preview() 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(), 'Body' => $this->record->getEmailBodyContent(),
'HideFormData' => $this->record->HideFormData, 'HideFormData' => $this->record->HideFormData,
'Fields' => $this->getPreviewFieldData() 'Fields' => $this->getPreviewFieldData()
)))->renderWith($this->record->EmailTemplate); )))->renderWith($this->record->EmailTemplate);
Config::unnest();
return $content;
} }
/** /**