$userId =
$params['userId'
];
$status =
$params['status'
];
if (!
$toMail || !
$fromName || !
$fromMail || !
$subject || !
$content || !
$userId) { $this->
View()->
assign(['success' => false, 'message' => 'All required fields needs to be filled.'
]);
return;
} $content =
preg_replace('`<br(?: /)?>([\\n\\r])`', '$1',
$params['content'
]);
$compiler =
new Shopware_Components_StringCompiler($this->
View()->
Engine());
$defaultContext =
[ 'sConfig' =>
Shopware()->
Config(),
];
$compiler->
setContext($defaultContext);
// Send eMail to customer
$mail->
IsHTML(false
);
$mail->From =
$compiler->
compileString($fromMail);
$mail->FromName =
$compiler->
compileString($fromName);
$mail->Subject =
$compiler->
compileString($subject);
$mail->Body =
$compiler->
compileString($content);