コード例 #1
0
 /**
  * @param InviteCreatedEvent $inviteCreatedEvent
  */
 public function onCreateInvite(InviteCreatedEvent $inviteCreatedEvent)
 {
     $invite = $inviteCreatedEvent->getInvite();
     if ($invite->getChannel() === InviteChannel::EMAIL) {
         $this->mailer->sendInviteEmail($invite);
     }
 }
コード例 #2
0
 /**
  * @param MessageCreatedEvent $messageCreatedEvent
  */
 public function onMessageCreated(MessageCreatedEvent $messageCreatedEvent)
 {
     $message = $messageCreatedEvent->getMessage();
     $title = sprintf('[TASTD %s] %s ', $message->getCategory(), $message->getContent());
     $content = $message->getContent();
     $this->mailer->sendMessageToAdmin($title, $content);
 }