transformTemplate() public method

public transformTemplate ( $template, $transformParams = [] )
Esempio n. 1
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);
 }
Esempio n. 2
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);
     }
 }
Esempio n. 3
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);
     }
 }