コード例 #1
0
ファイル: AbstractJournalItemMailer.php プロジェクト: ojs/ojs
 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
ファイル: CoreEventListener.php プロジェクト: beyzakokcan/ojs
 /**
  * @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');
     }
 }
コード例 #3
0
 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());
     }
 }
コード例 #4
0
 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
ファイル: CoreEventListener.php プロジェクト: ojs/ojs
 /**
  * @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
ファイル: UserEventListener.php プロジェクト: ojs/ojs
 /**
  * @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
ファイル: AdminEventListener.php プロジェクト: ojs/ojs
 /**
  * @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
ファイル: UserEventListener.php プロジェクト: beyzakokcan/ojs
 /**
  * @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());
 }