Skip to content

Commit

Permalink
make template, content property can be callable (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
videni authored and overtrue committed Sep 8, 2018
1 parent f755a29 commit 42e8cef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getMessageType()
*/
public function getContent(GatewayInterface $gateway = null)
{
return $this->content;
return is_callable($this->content) ? $this->content($gateway) : $this->content;
}

/**
Expand All @@ -92,7 +92,7 @@ public function getContent(GatewayInterface $gateway = null)
*/
public function getTemplate(GatewayInterface $gateway = null)
{
return $this->template;
return is_callable($this->template) ? $this->template($gateway): $this->template;
}

/**
Expand Down

0 comments on commit 42e8cef

Please sign in to comment.