public function sendTemplateMessage(
        $nb_template,
        $to = null,
        $cc = null,
        $bcc = null,
        array $params = null,
        array $attachments = null
    ) : bool
    {
        $nb_template = $this->discoverTemplate($nb_template);
        $nb_language = $this->discoverLanguage($nb_language);
        list($subject, $body_html, $body_text) = $this->prepareMessageUsingTemplate($nb_template, $params);

        return $this->sendMessage($nb_template->getServices(), $to, $bc, $bcc, $subject, $body_html, $body_text, $attachments);
    }
public function sendTemplateMessage(
        $nb_template,
        $to = null,
        $cc = null,
        $bcc = null,
        array $params = null,
        array $attachments = null
    ) : bool
    {
        $nb_template = $this->discoverTemplate($nb_template);
        $nb_language = $this->discoverLanguage($nb_language);
        list($subject, $body_html, $body_text) = $this->prepareMessageUsingTemplate($nb_template, $params);

        return $this->sendMessage($nb_template->getServices(), $to, $bc, $bcc, $subject, $body_html, $body_text, $attachments);
    }
public function sendTemplateMessage ( $ nb_template , $ to = null , $ cc = null , $ bcc = null , array $ params = null , array $ attachments = null ) : bool { $ nb_template = $ this -> discoverTemplate ( $ nb_template ) ; $ nb_language = $ this -> discoverLanguage ( $ nb_language ) ; list ( $ subject , $ body_html , $ body_text ) = $ this -> prepareMessageUsingTemplate ( $ nb_template , $ params ) ; return $ this -> sendMessage ( $ nb_template -> getServices ( ) , $ to , $ bc , $ bcc , $ subject , $ body_html , $ body_text , $ attachments ) ; }
Send a Message directly using a predefined template.
@param mixed $nb_template A Template instance, a child of CNabuDataObject containing a field named
nb_messaging_template_id or a valid Id.
@param CNabuUser|CNabuUserList|string|array $to A User or User List instance, an inbox as string or an array
of strings each one an inbox, to send TO.
@param CNabuUser|CNabuUserList|string|array $cc A User or User List instance, an inbox as string or an array
of strings each one an inbox, to send in Carbon Copy.
@param CNabuUser|CNabuUserList|string|array $bcc A User or User List instance, an inbox as string or an array
of strings each one an inbox, to send in Blind Carbon Copy.
@param array|null $params An associative array with additional data for the template.
@param array|null $attachments An array of attached files to send in the message.
@return bool Returns true if the message was posted.
@throws ENabuMessagingException Raises an exception if something is wrong.
Send a Message directly using a predefined template .