class EventSubscriber implements EventSubscriberInterface

An event subscriber for bzion events

Methods

__construct(Swift_Mailer $mailer, Twig_Environment $twig, string $from, string $siteTitle)

Constructor

static array
getSubscribedEvents()

Returns all the events that this subscriber handles, and which method handles each one

onNewMessage(NewMessageEvent $event)

Called every time a new message is sent

onNewNotification(NewNotificationEvent $event)

Called every time a new notification is sent

notify(Event $event, string $name)

Called when an event needs to notify a user

conversation(Event $event, string $name)

Called when a conversation event needs to be stored in the database

emailNotification(Notification $notification)

Notify the user about a notification by e-

void
sendEmails(string $subject, int[] $recipients, string $template, array $params = array())

Send emails to a list of recipients

Details

at line line 51
__construct(Swift_Mailer $mailer, Twig_Environment $twig, string $from, string $siteTitle)

Constructor

You will probably not need to instantiate an object of this class, Symfony already does the hard work for us

Parameters

Swift_Mailer $mailer The mailer
Twig_Environment $twig The twig environment
string $from The FROM e-mail address
string $siteTitle The title of the website

at line line 65
static array getSubscribedEvents()

Returns all the events that this subscriber handles, and which method handles each one

Return Value

array

at line line 88
onNewMessage(NewMessageEvent $event)

Called every time a new message is sent

Parameters

NewMessageEvent $event The event

at line line 117
onNewNotification(NewNotificationEvent $event)

Called every time a new notification is sent

Parameters

NewNotificationEvent $event The event

at line line 135
notify(Event $event, string $name)

Called when an event needs to notify a user

Parameters

Event $event The event
string $name The name of the event

at line line 146
conversation(Event $event, string $name)

Called when a conversation event needs to be stored in the database

Parameters

Event $event The event
string $name The name of the event

at line line 155
emailNotification(Notification $notification)

Notify the user about a notification by e-

Parameters

Notification $notification The notification that will be mailed

at line line 179
void sendEmails(string $subject, int[] $recipients, string $template, array $params = array())

Send emails to a list of recipients

Parameters

string $subject The subject of the messages
int[] $recipients The IDs of the players to which the messages will be sent
string $template The twig template name for the e-mail body
array $params Any extra parameters to pass to twig

Return Value

void