mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
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:
commit
630c5c3395
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user