for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* balloon
*
* @copyright Copryright (c) 2012-2018 gyselroth GmbH (https://gyselroth.com)
* @license GPL-3.0 https://opensource.org/licenses/GPL-3.0
*/
namespace Balloon\App\Notification;
use Balloon\Server\User;
class UserMessage implements MessageInterface
{
* Subject.
* @var string
protected $subject;
* Message.
protected $body;
* Template handler.
* @var TemplateHandler
protected $template;
* Constructor.
public function __construct(string $subject, string $body, TemplateHandler $template)
$this->subject = $subject;
$this->body = $body;
$this->template = $template;
}
* {@inheritdoc}
public function getSubject(User $user): string
return $this->template->getSubject('user_message', [
'user' => $user,
'user_subject' => $this->subject,
]);
public function getBody(User $user): string
return $this->template->getBody('user_message', [
'user_body' => $this->body,
public function renderTemplate(string $template, User $user): string
return $this->template->renderTemplate('user_message', $template, [