From 42e8cefc3830395ad1d092fbf0f468c35fe86e34 Mon Sep 17 00:00:00 2001 From: vidy Date: Sat, 8 Sep 2018 18:11:45 +0800 Subject: [PATCH] make template, content property can be callable (#132) --- src/Message.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Message.php b/src/Message.php index 9208be0..486d9df 100644 --- a/src/Message.php +++ b/src/Message.php @@ -80,7 +80,7 @@ class Message implements MessageInterface */ public function getContent(GatewayInterface $gateway = null) { - return $this->content; + return is_callable($this->content) ? $this->content($gateway) : $this->content; } /** @@ -92,7 +92,7 @@ class Message implements MessageInterface */ public function getTemplate(GatewayInterface $gateway = null) { - return $this->template; + return is_callable($this->template) ? $this->template($gateway): $this->template; } /** -- GitLab