@param string $subject
@param string $message
@param string $link

@return Notification
347702
public function createNotification($subject, $message = null, $link = null)
    {
        $notification = new Notification();
        $notification
            ->setSubject($subject)
            ->setMessage($message)
            ->setLink($link);

        $event = new NotificationEvent($notification);
        $this->dispatcher->dispatch(MgiletNotificationEvents::CREATED, $event);

        return $notification;
    }
83414
public function fire($event, $subject = null, $message = null)
    {
        $this->stop = false;

        try {
            foreach ([$event . ':before', $event, $event . ':after'] as $eventName) {
                if ($this->stop) {
                    break;
                }

                $subject = $this->call($eventName, $subject, $message);
            }

            return $subject;
        } catch (\Exception $e) {
            if (!isset($this->events[$event . ':exception'])) {
                throw $e;
            }

            return $this->call($event . ':exception', $e, $e->getMessage());
        }
    }
1090703
public function executeSending( $subject, $body, $subscriber )
    {
        $email = $subscriber->attribute( 'email' );
        $parameters = array();
        $parameters['content_type'] = $this->emailContentType;
        $parameters['from'] = $this->emailFrom;
        $transport = eZNotificationTransport::instance( 'ezmail' );
        $result = $transport->send( array( $email ), $subject, $body, null, $parameters );
        if ( $result === false )
        {
            throw new Exception( 'Send email error! Subscriber id:' .$subscriber->attribute( 'id' ) );
        }
        eZDebugSetting::writeNotice( 'extension-ezcomments', "An email has been sent to '$email' (subject: $subject)", __METHOD__ );
    }
549427
protected function call($eventName, $subject = null, $message = null)
    {
        if (!isset($this->events[$eventName])) {
            return $subject;
        }

        foreach ($this->events[$eventName] as $listener) {
            if ($this->stop) {
                break;
            }

            $subject = $listener($this->container, $subject, $message, $eventName);
        }

        return $subject;
    }
187768
public function queueSubscribe($subject, $queue, \Closure $callback)
    {
        $c = function ($message) use ($callback) {
            $message->setBody($this->encoder->decode($message->getBody()));
            $callback($message);
        };
        parent::queueSubscribe($subject, $queue, $c);
    }
336811
public function action(string $message, string $link, string $class = 'btn btn-primary') : Mail
  {
    $this->body .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"{$class}\">
<tbody>
  <tr>
    <td align=\"left\">
      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
        <tbody>
          <tr>
            <td>
              <a href=\"{$link}\" target=\"_blank\">{$message}</a>
            </td>
          </tr>
        </tbody>
      </table>
    </td>
  </tr>
</tbody>
</table>
";
    return $this;
  }
1296223
public function moveMessageAction(Message $message, Subject $newSubject)
    {
        $forum = $newSubject->getCategory()->getForum();
        $this->checkAccess($forum);
        $this->manager->moveMessage($message, $newSubject);

        return new RedirectResponse(
            $this->generateUrl('claro_forum_subjects', array('category' => $newSubject->getCategory()->getId()))
        );
    }
857698
public function sendMail($to, $subject = '', $message = '', $headers = '')
    {
        if (empty($headers)) {
            $headers = 'From: ' . APP_SYS_EMAIL;
        }
        mail($to, $subject, $message, $headers);
    }
1126420
public function emailUser($target, $subject = null, $text = null, $ccme = null)
	{
		// Get the token.
		$token = $this->getToken($target, 'emailuser');

		// Build the request path.
		$path = '?action=emailuser';

		// Build the request data.
		$data = array(
			'target'  => $target,
			'token'   => $token,
			'subject' => $subject,
			'text'    => $text,
			'ccme'    => $ccme,
		);

		// Send the request.
		$response = $this->client->post($this->fetchUrl($path), $data);

		return $this->validateResponse($response);
	}
225219
public function createMessageAction(Subject $subject)
    {
        $form = $this->container->get('form.factory')->create(new MessageType, new Message());
        $form->handleRequest($this->get('request'));


        if ($form->isValid()) {
            $message = $form->getData();
            $this->manager->createMessage($message, $subject);
        }

        return new RedirectResponse(
            $this->generateUrl('claro_forum_messages', array('subject' => $subject->getId()))
        );
    }
763378
public static function report(String $subject, String $message, String $destination = NULL, String $time = NULL) : Bool
    {
        return Helper::report($subject, $message, $destination, $time);
    }
548460
public function warning($message, ReviewInterface $review, ReviewableInterface $subject)
    {
        $this->report(Issue::LEVEL_WARNING, $message, $review, $subject);

        return $this;
    }
1054155
public function setLink(NotificationInterface $notification, $link, $flush = false)
    {
        $notification->setLink($link);
        $this->flush($flush);

        $event = new NotificationEvent($notification);
        $this->dispatcher->dispatch(MgiletNotificationEvents::MODIFIED, $event);

        return $notification;
    }
1027756
public function subscribe($subject, \Closure $callback)
    {
        $c = function ($message) use ($callback) {
            $message->setBody($this->encoder->decode($message->getBody()));
            $callback($message);
        };
        return parent::subscribe($subject, $c);
    }
691073
public function send($to, $subject, $message, $attachments = array(), $cc = array())
    {
        $mail = new \Swift_Message($subject, $message, 'text/html', 'UTF-8');
        if($this->from != '')
        {
            $mail->setFrom($this->from, $this->fromName);
        } else {
            $mail->setFrom('framework@gestionlan.com', "Manuel de Gestionlan");

        }
        $mail->setTo($to);
        $mail->setCc($cc);
        if($this->replyTo) {
            foreach ($this->replyTo as $addr => $name) {
                $mail->setReplyTo($addr, $name);
            }
        }
        foreach ($attachments as $key => $attachment) {
            $atta = \Swift_Attachment::fromPath($attachment);
            if (!is_int($key)) {
                $atta->setFilename($key);
            }
            $mail->attach($atta);
        }

        return $this->done($mail);
    }
452915
public function assertEmail($subject, $address) {
    $message = $this->getMailCatcherClient()->searchOne([
      Message::SUBJECT_CRITERIA => $subject,
      Message::TO_CRITERIA => $address
    ]);
    if (is_null($message)) {
      throw new Exception("Message not found.");
    }
  }
1067117
protected function getDefaultMessage($from, $encoding, $to, $subject, $body) {
        if(is_string($from)) {
            $from = array('email' => $from, 'name' => $from);
        }

        $message = new MailMessage();
        $message->setFrom($from['email'], $from['name'])
            ->setEncoding($encoding)
            ->setSubject($subject)
            ->setBody($body)
            ->setTo($to);

        return $message;
    }