示例#1
0
 protected function sendMail(JournalItemEvent $itemEvent, $item, $action)
 {
     $journalItem = $itemEvent->getItem();
     foreach ($this->ojsMailer->getJournalRelatedUsers() as $user) {
         $this->ojsMailer->sendToUser($user, 'A ' . $item . ' ' . $action . ' -> ' . $journalItem->getJournal()->getTitle(), 'A ' . $item . ' ' . $action . ' -> ' . $journalItem->getJournal()->getTitle() . ' -> by ' . $this->user->getUsername());
     }
 }
示例#2
0
 /**
  * @param CoreEvent $event
  */
 public function onInstall3Party(CoreEvent $event)
 {
     $adminUsers = $this->getAdminUsers();
     foreach ($adminUsers as $user) {
         $this->ojsMailer->sendToUser($user, 'Core Event : Core Install 3 Party', 'Core Event : Core Install 3 Party');
     }
 }
 protected function sendMail(JournalItemEvent $itemEvent, $item, $action)
 {
     $mailUsers = $this->em->getRepository('OjsUserBundle:User')->findUsersByJournalRole(['ROLE_JOURNAL_MANAGER', 'ROLE_EDITOR']);
     $journalItem = $itemEvent->getItem();
     foreach ($mailUsers as $user) {
         $this->ojsMailer->sendToUser($user, 'A ' . $item . ' ' . $action . ' -> ' . $journalItem->getJournal()->getTitle(), 'A ' . $item . ' ' . $action . ' -> ' . $journalItem->getJournal()->getTitle() . ' -> by ' . $this->user->getUsername());
     }
 }
 public function sendAnnouncement(JournalItemEvent $itemEvent)
 {
     /** @var JournalAnnouncement $announcement */
     $announcement = $itemEvent->getItem();
     $mailList = $this->em->getRepository('OjsJournalBundle:SubscribeMailList')->findBy(['journal' => $announcement->getJournal()]);
     foreach ($mailList as $mail) {
         $this->ojsMailer->send($announcement->getTitle(), $announcement->getContent(), $mail->getMail(), $mail->getMail());
     }
 }
示例#5
0
 /**
  * @param CoreEvent $event
  */
 public function onInstall3Party(CoreEvent $event)
 {
     $getMailEvent = $this->ojsMailer->getEventByName(CoreEvents::OJS_INSTALL_BASE);
     if (!$getMailEvent) {
         return;
     }
     foreach ($this->ojsMailer->getAdminUsers() as $user) {
         $transformParams = ['bundleName' => $event->getBundleName(), 'receiver.username' => $user->getUsername(), 'receiver.fullName' => $user->getFullName()];
         $template = $this->ojsMailer->transformTemplate($getMailEvent->getTemplate(), $transformParams);
         $this->ojsMailer->sendToUser($user, $getMailEvent->getSubject(), $template);
     }
 }
示例#6
0
 /**
  * @param GetResponseUserEvent $event
  */
 public function onProfileEditCompleted(GetResponseUserEvent $event)
 {
     $getMailEvent = $this->ojsMailer->getEventByName(FOSUserEvents::PROFILE_EDIT_COMPLETED);
     if (!$getMailEvent) {
         return;
     }
     /** @var User $user */
     $user = $event->getUser();
     $transformParams = ['user.username' => $user->getUsername(), 'user.fullName' => $user->getFullName(), 'user.mail' => $user->getEmail()];
     $template = $this->ojsMailer->transformTemplate($getMailEvent->getTemplate(), $transformParams);
     $this->ojsMailer->sendToUser($user, $getMailEvent->getSubject(), $template);
 }
示例#7
0
 /**
  * @param AdminEvent $event
  */
 public function onSettingsChange(AdminEvent $event)
 {
     $adminUsers = $this->getAdminUsers();
     foreach ($adminUsers as $user) {
         $this->ojsMailer->sendToUser($user, 'Admin Event : Admin System Settings Change -> ' . $event->getEventType(), 'Admin Event : Admin System Settings Change -> ' . $event->getEventType() . ' -> by ' . $event->getUser()->getUsername());
     }
 }
示例#8
0
 /**
  * @param AdminEvent $event
  */
 public function onSettingsChange(AdminEvent $event)
 {
     $getMailEvent = $this->ojsMailer->getEventByName(AdminEvents::SETTINGS_CHANGE);
     if (!$getMailEvent) {
         return;
     }
     foreach ($this->ojsMailer->getAdminUsers() as $user) {
         $transformParams = ['done.by' => $this->ojsMailer->currentUser()->getUsername(), 'receiver.username' => $user->getUsername(), 'receiver.fullName' => $user->getFullName()];
         $template = $this->ojsMailer->transformTemplate($getMailEvent->getTemplate(), $transformParams);
         $this->ojsMailer->sendToUser($user, $getMailEvent->getSubject(), $template);
     }
 }
示例#9
0
 /**
  * @param GetResponseUserEvent $userResponseEvent
  */
 public function onProfileEditCompleted(GetResponseUserEvent $userResponseEvent)
 {
     $user = $userResponseEvent->getUser();
     $this->ojsMailer->sendToUser($user, 'User Event : User Profile Edit Completed', 'User Event -> User Profile Edit Completed -> ' . $user->getEmail());
 }