Ejemplo n.º 1
0
 /**
  * @param UserInterface $user
  * @param MessageInterface $message
  * @return bool
  */
 public function sendNotification(UserInterface $user, MessageInterface $message)
 {
     $this->telegramCli->msg($user->getPhoneNumber()->getValue(), $message->getText());
     return true;
 }
Ejemplo n.º 2
0
 /**
  * @param UserInterface $user
  * @param MessageInterface $message
  * @return bool
  */
 public function sendNotification(UserInterface $user, MessageInterface $message)
 {
     $msg = \Swift_Message::newInstance()->setSubject("Message from me")->setFrom($this->from)->setTo(array($user->getEmail()->getValue()))->setBody($message->getText());
     $this->mailer->send($msg);
 }
Ejemplo n.º 3
0
    /**
     * @param UserInterface $user
     * @return bool
     */
    public function update(UserInterface $user)
    {
        $tableName = self::TABLE;
        $sql = <<<SQL
            UPDATE `{$tableName}`
            SET `phone_number` = ':phone_number',
                `email` : ':email', `preferred_notify_way` = ':preferred_notify_way'
            WHERE
              `id` = ':id'
SQL;
        $statement = $this->pdo->prepare($sql);
        $statement->bindValue(array(':id', ':phone_number', ':email', ':preferred_notify_way'), array($user->getId()->getValue(), $user->getPhoneNumber()->getValue(), $user->getEmail()->getValue(), $user->getPreferredNotifyWay()->getValue()));
        $statement->execute();
    }