Skip to content

Commit

Permalink
Render templates before sending them
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvdlinde committed Jan 23, 2020
1 parent 8bc15e7 commit 135a6a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions api/src/Service/MailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ public function sendEmail(Message $message)

$sender = $this->commonGroundService->getResource($message->getSender());
$reciever = $this->commonGroundService->getResource($message->getReciever());
$content = $this->commonGroundService->getResource($message->getContent());
//$html = $this->commonGroundService->getResource($message->getContent().'/render');
$content = $this->commonGroundService->getResource($message->getContent().'/render');
$html = $content['content'];
$text = strip_tags(preg_replace('#<br\s*/?>#i', "\n", $html), '\n');

Expand Down
3 changes: 1 addition & 2 deletions api/src/Service/MessageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public function sendMessage(Message $message)
{
$sender = $this->commonGroundService->getResource($message->getSender());
$reciever = $this->commonGroundService->getResource($message->getReciever());
$content = $this->commonGroundService->getResource($message->getContent());
//$html = $this->commonGroundService->getResource($message->getContent().'/render');
$content = $this->commonGroundService->getResource($message->getContent().'/render');
$html = $content['content'];
$text = strip_tags(preg_replace('#<br\s*/?>#i', "\n", $html), '\n');

Expand Down

0 comments on commit 135a6a2

Please sign in to comment.