Best Atoum code snippet using mailer.setSubject
Mail.php
Source:Mail.php
...13 }14 public function suAdminCityhallAccess($user, $content)15 {16 $message = \Swift_Message::newInstance()17 ->setSubject('NOUS Ensemble Accès de votre compte super-admin communauté')18 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))19 ->setTo($user->getEmail());20 $message->addPart($content, 'text/html');21 $this->container->get('mailer')->send($message);22 }23 public function adminCityhallAccess($user, $content)24 {25 $message = \Swift_Message::newInstance()26 ->setSubject('NOUS Ensemble Accès de votre compte admin communauté')27 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))28 ->setTo($user->getEmail());29 $message->addPart($content, 'text/html');30 $this->container->get('mailer')->send($message);31 }32 public function updateReportingModerate($user, $content, $reporting)33 {34 $message = \Swift_Message::newInstance()35 ->setSubject('NOUS Ensemble Votre signalement ' . $reporting->getTitle())36 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))37 ->setTo($user->getEmail());38 $message->addPart($content, 'text/html');39 $this->container->get('mailer')->send($message);40 }41 public function userReport($content, $object, $to)42 {43 $message = \Swift_Message::newInstance()44 ->setSubject('NOUS Ensemble Signalement de compte citoyen : ' . $object)45 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))46 ->setTo($to);47 $message->addPart($content, 'text/html');48 $this->container->get('mailer')->send($message);49 }50 public function enableUser($user, $content, $enable)51 {52 $message = \Swift_Message::newInstance()53 ->setSubject('NOUS Ensemble Votre compte citoyen a été ' . ($enable ? 'activé' : 'désactivé') . ' par la communauté')54 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))55 ->setTo($user->getEmail());56 $message->addPart($content, 'text/html');57 $this->container->get('mailer')->send($message);58 }59 60 public function acceptUser($user, $content)61 {62 $message = \Swift_Message::newInstance()63 ->setSubject('NOUS Ensemble Votre demande de liaison à une Communauté a été acceptée')64 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))65 ->setTo($user->getEmail());66 $message->addPart($content, 'text/html');67 $this->container->get('mailer')->send($message);68 }69 70 public function refuseUser($user, $content)71 {72 $message = \Swift_Message::newInstance()73 ->setSubject('NOUS Ensemble Votre demande de liaison à une Communauté a été refusée')74 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))75 ->setTo($user->getEmail());76 $message->addPart($content, 'text/html');77 $this->container->get('mailer')->send($message);78 }79 public function enableUserAdmin($user, $content, $enable)80 {81 $message = \Swift_Message::newInstance()82 ->setSubject('NOUS Ensemble Votre compte admin communauté a été ' . ($enable ? 'activé' : 'désactivé') . ' par la communauté')83 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))84 ->setTo($user->getEmail());85 $message->addPart($content, 'text/html');86 $this->container->get('mailer')->send($message);87 }88 public function commentDelete($mails, $content)89 {90 $message = \Swift_Message::newInstance()91 ->setSubject('NOUS Ensemble Suppression dâun commentaire')92 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))93 ->setTo($mails);94 $message->addPart($content, 'text/html');95 $this->container->get('mailer')->send($message);96 }97 public function moderateAssociation($user, $content)98 {99 $message = \Swift_Message::newInstance()100 ->setSubject('NOUS Ensemble Votre groupe/association a été accepté par la communauté.')101 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))102 ->setTo($user->getEmail());103 $message->addPart($content, 'text/html');104 $this->container->get('mailer')->send($message);105 }106 public function enableAssociation($user, $content, $enable)107 {108 $message = \Swift_Message::newInstance()109 ->setSubject('NOUS Ensemble Votre groupe / association a été ' . ($enable ? 'activé' : 'désactivé') . ' par la communauté')110 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))111 ->setTo($user->getEmail());112 $message->addPart($content, 'text/html');113 $this->container->get('mailer')->send($message);114 }115 public function moderateMerchant($user, $content)116 {117 $message = \Swift_Message::newInstance()118 ->setSubject('NOUS Ensemble Votre commerce / partenaire a été accepté par la communauté')119 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))120 ->setTo($user->getEmail());121 $message->addPart($content, 'text/html');122 $this->container->get('mailer')->send($message);123 }124 public function enableMerchant($user, $content, $enable)125 {126 $message = \Swift_Message::newInstance()127 ->setSubject('NOUS Ensemble Votre commerce / partenaire a été ' . ($enable ? 'activé' : 'désactivé') . ' par la communauté')128 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))129 ->setTo($user->getEmail());130 $message->addPart($content, 'text/html');131 $this->container->get('mailer')->send($message);132 }133 public function updateArticle($user, $content, $article)134 {135 $message = \Swift_Message::newInstance()136 ->setSubject('NOUS Ensemble Votre article ' . $article->getTitle() . ' a été mis à jour')137 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))138 ->setTo($user->getEmail());139 $message->addPart($content, 'text/html');140 $this->container->get('mailer')->send($message);141 }142 public function enableArticle($user, $content, $enable)143 {144 $message = \Swift_Message::newInstance()145 ->setSubject('NOUS Ensemble Votre article a été ' . ($enable ? 'activé' : 'désactivé') . ' par la communauté')146 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))147 ->setTo($user->getEmail());148 $message->addPart($content, 'text/html');149 $this->container->get('mailer')->send($message);150 }151 public function updateEvent($user, $content, $event)152 {153 $message = \Swift_Message::newInstance()154 ->setSubject('NOUS Ensemble Votre événement ' . $event->getTitle() . ' a été mis à jour')155 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))156 ->setTo($user->getEmail());157 $message->addPart($content, 'text/html');158 $this->container->get('mailer')->send($message);159 }160 public function enableEvent($user, $content, $enable)161 {162 $message = \Swift_Message::newInstance()163 ->setSubject('NOUS Ensemble Votre événement a été ' . ($enable ? 'activé' : 'désactivé') . ' par la communauté')164 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))165 ->setTo($user->getEmail());166 $message->addPart($content, 'text/html');167 $this->container->get('mailer')->send($message);168 }169 public function enableGoodPlan($user, $content, $enable)170 {171 $message = \Swift_Message::newInstance()172 ->setSubject('NOUS Ensemble Votre bon plan a été ' . ($enable ? 'activé' : 'désactivé') . ' par la communauté')173 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))174 ->setTo($user->getEmail());175 $message->addPart($content, 'text/html');176 $this->container->get('mailer')->send($message);177 }178 public function moderateEvent($user, $content,$entity)179 {180 $message = \Swift_Message::newInstance()181 ->setSubject('NOUS Ensemble Votre événement a été '.($entity->getModerate() == 'accepted' ? 'accepté' : 'refusé').' par la communauté')182 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))183 ->setTo($user->getEmail());184 $message->addPart($content, 'text/html');185 $this->container->get('mailer')->send($message);186 }187 public function moderateGoodPlan($user, $content)188 {189 $message = \Swift_Message::newInstance()190 ->setSubject('NOUS Ensemble Votre bon plan a été accepté par la communauté')191 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))192 ->setTo($user->getEmail());193 $message->addPart($content, 'text/html');194 $this->container->get('mailer')->send($message);195 }196 197 public function newArticleEvent($content)198 {199 $message = \Swift_Message::newInstance()200 ->setSubject('NOUS Ensemble Un événement associé à un article a été créé')201 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))202 ->setTo($this->container->getParameter('event_email'));203 $message->addPart($content, 'text/html');204 $this->container->get('mailer')->send($message);205 }206 207 public function deleteAccountMail($subject, $content)208 {209 $message = \Swift_Message::newInstance()210 ->setSubject($subject)211 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))212 ->setTo($this->container->getParameter('admin_email'));213 $message->addPart($content, 'text/html');214 $this->container->get('mailer')->send($message);215 }216 public function addSuAdminAssociation($user, $content, $association)217 {218 $message = \Swift_Message::newInstance()219 ->setSubject('NOUS Ensemble Vous êtes maintenant super-administrateur du groupe / association ' . $association->getName())220 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))221 ->setTo($user->getEmail());222 $message->addPart($content, 'text/html');223 $this->container->get('mailer')->send($message);224 }225 public function removeSuAdminAssociation($user, $content, $association)226 {227 $message = \Swift_Message::newInstance()228 ->setSubject('NOUS Ensemble Vous n\êtes plus super-administrateur du groupe / association ' . $association->getName())229 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))230 ->setTo($user->getEmail());231 $message->addPart($content, 'text/html');232 $this->container->get('mailer')->send($message);233 }234 public function addSuAdminMerchant($user, $content, $merchant)235 {236 $message = \Swift_Message::newInstance()237 ->setSubject('NOUS Ensemble Vous êtes maintenant super-administrateur du commerce / partenaire ' . $merchant->getName())238 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))239 ->setTo($user->getEmail());240 $message->addPart($content, 'text/html');241 $this->container->get('mailer')->send($message);242 }243 public function removeSuAdminMerchant($user, $content, $merchant)244 {245 $message = \Swift_Message::newInstance()246 ->setSubject('NOUS Ensemble Vous n\êtes plus super-administrateur du commerce / partenaire ' . $merchant->getName())247 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))248 ->setTo($user->getEmail());249 $message->addPart($content, 'text/html');250 $this->container->get('mailer')->send($message);251 }252 //api mails253 public function contactMail($body, $to, $objet, $filepath=null)254 {255 /*$body = $this->container->get('templating')->renderResponse('AppBundle:Mail:contact.html.twig', [256 'user' => $user,257 'content' => $content,258 'photo' => $photo,259 'location' => $location260 ]);*/261 $message = \Swift_Message::newInstance()262 ->setSubject('NOUS Ensemble - ' . $objet)263 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))264 ->setTo($to);265 if($filepath && file_exists($filepath)) {266 $message->attach(\Swift_Attachment::fromPath($filepath));267 }268 /*dump($message->attach(\Swift_Attachment::fromPath($filepath)));269 exit;*/270 $message->addPart($body, 'text/html');271 $this->container->get('mailer')->send($message);272 }273 public function contactConfirmationMail($body, $object, $user)274 {275 $message = \Swift_Message::newInstance()276 ->setSubject('NOUS Ensemble - ' . $object)277 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))278 ->setTo($user->getEmail());279 $message->addPart($body, 'text/html');280 $this->container->get('mailer')->send($message);281 }282 public function sendCreationMail($user, $type)283 {284 $body = $this->container->get('templating')->render('AppBundle:Mail:accountCreation.html.twig', [285 'user' => $user,286 'type' => $type,287 ]);288 $message = \Swift_Message::newInstance()289 ->setSubject('NOUS Ensemble Compte ' . $type . ' en attente de validation')290 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))291 ->setTo($user->getEmail());292 $message->addPart($body, 'text/html');293 $this->container->get('mailer')->send($message);294 }295 public function sendResettingMail($user, $password)296 {297 $body = $this->container->get('templating')->render('AppBundle:Mail:resetting_password.html.twig', [298 'password' => $password,299 ]);300 $message = \Swift_Message::newInstance()301 ->setSubject('NOUS Ensemble Demande de réinitialisation du mot de passe')302 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))303 ->setTo($user->getEmail());304 $message->addPart($body, 'text/html');305 $this->container->get('mailer')->send($message);306 }307 public function sendBenevolesMail($sender, $user, $object, $email, $event, $account, $type)308 {309 $body = $this->container->get('templating')->render('AppBundle:Mail:benvoles.html.twig', [310 'email' => $email,311 'event' => $event,312 'account' => $account,313 'type' => $type == "merchant" ? "du commerce / partenaire" : "du groupe / association",314 ]);315 $message = \Swift_Message::newInstance()316 ->setSubject('NOUS Ensemble ' . $object)317 ->setFrom($sender->getEmail())318 ->setTo($user->getEmail());319 $message->addPart($body, 'text/html');320 $this->container->get('mailer')->send($message);321 }322 public function sendRoomMail($sender, $user, $event, $content)323 {324 $body = $this->container->get('templating')->render('AppBundle:Mail:roomAsking.html.twig', [325 'sender' => $sender,326 'event' => $event,327 'content' => $content,328 ]);329 $message = \Swift_Message::newInstance()330 ->setSubject('NOUS Ensemble Demande de réservation d\'une salle')331 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))332 //->setFrom($sender->getEmail())333 ->setTo($user);334 $message->addPart($body, 'text/html');335 $this->container->get('mailer')->send($message);336 }337 public function sendConfirmationMail($user, $email, $password)338 {339 $body = $this->container->get('templating')->render('AppBundle:Mail:confirmation.html.twig', [340 'email' => $email,341 'password' => $password,342 'firstname' => $user->getFirstname(),343 'lastname' => $user->getLastname(),344 ]);345 $message = \Swift_Message::newInstance()346 ->setSubject('NOUS Ensemble Validation Compte')347 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))348 ->setTo($email);349 $message->addPart($body, 'text/html');350 $this->container->get('mailer')->send($message);351 }352 public function sendInfoAdminMail($email, $user, $type, $entity)353 {354 $body = $this->container->get('templating')->render('AppBundle:Mail:addAdmin.html.twig', [355 'user' => $user,356 'type' => $type,357 'entity' => $entity358 ]);359 $account = ($type == 'association') ? " du groupe / association " : " du commerce / partenaire ";360 $subject ="NOUS Ensemble Vous êtes maintenant administrateur " . $account . " " . $entity->getName();361 $message = \Swift_Message::newInstance()362 ->setSubject($subject)363 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))364 ->setTo($email);365 $message->addPart($body, 'text/html');366 $this->container->get('mailer')->send($message);367 }368 public function sendInvitationMail($email, $user)369 {370 $body = $this->container->get('templating')->render('AppBundle:Mail:invitation.html.twig', [371 'user' => $user,372 ]);373 $message = \Swift_Message::newInstance()374 ->setSubject('NOUS Ensemble ' . $user->getLastname() . " vous a invité à rejoindre NOUS-Ensemble")375 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))376 ->setTo($email);377 $message->addPart($body, 'text/html');378 $this->container->get('mailer')->send($message);379 }380 public function sendJoinPrivateCommunity($email, $user,$community)381 {382 $body = $this->container->get('templating')->render('AppBundle:Mail:joinPrivateCommunity.html.twig', [383 'user' => $user,384 'community' => $community385 ]);386 $message = \Swift_Message::newInstance()387 ->setSubject('NOUS Ensemble ' . $user->getLastname() . " souhaite rejoindre votre communauté privée ".$community->getName())388 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))389 ->setTo($email);390 $message->addPart($body, 'text/html');391 $this->container->get('mailer')->send($message);392 }393 public function sendCarpoolAnswerCreator($carpool, $user,$phoneUser)394 {395 $body = $this->container->get('templating')->render('AppBundle:Mail:carpoolAnswerCreator.html.twig', [396 'user' => $user,397 'phoneUser' => $phoneUser,398 'carpool' => $carpool399 ]);400 $message = \Swift_Message::newInstance()401 ->setSubject('NOUS Ensemble ' . $user->getLastname() . " souhaite rejoindre votre covoiturage")402 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))403 ->setTo($carpool->getCreateBy()->getEmail());404 $message->addPart($body, 'text/html');405 $this->container->get('mailer')->send($message);406 }407 public function sendCarpoolAnswerUser($carpool, $user)408 {409 $body = $this->container->get('templating')->render('AppBundle:Mail:carpoolAnswerUser.html.twig', [410 'user' => $user,411 'carpool' => $carpool412 ]);413 $message = \Swift_Message::newInstance()414 ->setSubject('NOUS Ensemble demande de covoiturage')415 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))416 ->setTo($user->getEmail());417 $message->addPart($body, 'text/html');418 $this->container->get('mailer')->send($message);419 }420 public function sendCancelCarpoolAnswerCreator($carpool, $user)421 {422 $body = $this->container->get('templating')->render('AppBundle:Mail:carpoolCancelAnswerCreator.html.twig', [423 'user' => $user,424 'carpool' => $carpool425 ]);426 $message = \Swift_Message::newInstance()427 ->setSubject('NOUS Ensemble ' . $user->getLastname() . " a annulé sa demande de covoiturage")428 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))429 ->setTo($carpool->getCreateBy()->getEmail());430 $message->addPart($body, 'text/html');431 $this->container->get('mailer')->send($message);432 }433 public function sendCancelCarpoolAnswerUser($carpool, $user)434 {435 $body = $this->container->get('templating')->render('AppBundle:Mail:carpoolCancelAnswerUser.html.twig', [436 'user' => $user,437 'carpool' => $carpool438 ]);439 $message = \Swift_Message::newInstance()440 ->setSubject('NOUS Ensemble annulation de la demande de covoiturage')441 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))442 ->setTo($user->getEmail());443 $message->addPart($body, 'text/html');444 $this->container->get('mailer')->send($message);445 }446 public function sendJoinMerchantOrAssociation($user,$merchant,$phone, $merchantOrAssociation)447 {448 $body = $this->container->get('templating')->render('AppBundle:Mail:joinMerchantOrAssociation.html.twig', [449 'user' => $user,450 'phone' => $phone,451 'merchant' => $merchant,452 'merchantOrAssociation' => $merchantOrAssociation453 ]);454 if($merchantOrAssociation == 'merchant') {455 $subject = 'NOUS Ensemble ' . $user->getLastname() . " souhaite rejoindre Votre commerce / partenaire ".$merchant->getName();456 }else{457 $subject = 'NOUS Ensemble ' . $user->getLastname() . " souhaite rejoindre votre Groupe / Association ".$merchant->getName();458 }459 $message = \Swift_Message::newInstance()460 ->setSubject($subject)461 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))462 ->setTo($merchant->getSuAdmin()->getEmail());463 $message->addPart($body, 'text/html');464 $this->container->get('mailer')->send($message);465 }466 public function contactMerchant($goodplan, $user, $data)467 {468 $body = $this->container->get('templating')->render('AppBundle:Mail:contactMerchant.html.twig', [469 'user' => $user,470 'goodplan' => $goodplan,471 'data' => $data472 ]);473 $message = \Swift_Message::newInstance()474 ->setSubject('NOUS Ensemble d\'information')475 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))476 ->setTo($goodplan->getMerchant()->getSuAdmin()->getEmail());477 $message->addPart($body, 'text/html');478 $this->container->get('mailer')->send($message);479 }480 /**481 * @param Carpooling $carpool482 * @param User $user483 */484 public function sendCarpoolRecap($carpool, $user)485 {486 $body = $this->container->get('templating')->render('AppBundle:Mail:mailRecapCarpool.html.twig', [487 'user' => $user,488 'carpool' => $carpool,489 ]);490 $message = \Swift_Message::newInstance()491 ->setSubject('NOUS Ensemble d\'information')492 ->setFrom(array($this->container->getParameter('no_reply_email') => $this->container->getParameter('no_reply_name')))493 ->setTo($user->getEmail());494 $message->addPart($body, 'text/html');495 $this->container->get('mailer')->send($message);496 }497}...
ApplicationEventListener.php
Source:ApplicationEventListener.php
...42 public function sendEmailToUserOnNewApp(ApplicationEvent $event)43 {44 $app = $event->getApplication();45 $message = \Swift_Message::newInstance()46 ->setSubject('New Application')47 ->setFrom($this->from)48 ->setTo($app->getUser()->getEmail())49 ->setBody(50 $this->twig->render(51 'AdminBundle:Emails:applicationNew.html.twig',52 array( 'app' => $app )53 ),54 'text/html'55 );56 $this->mailer->send($message);57 }58 public function sendEmailToAdminOnNewApp(ApplicationEvent $event)59 {60 $app = $event->getApplication();61 $message = \Swift_Message::newInstance()62 ->setSubject('New Application - #'.$app->getId())63 ->setFrom($this->from)64 ->setTo($this->adminemail)65 ->setBody(66 $this->twig->render(67 'AdminBundle:Emails:applicationNewToAdmin.html.twig',68 array( 'app' => $app )69 ),70 'text/html'71 );72 $this->mailer->send($message);73 }74 public function lockApp(ApplicationEvent $event)75 {76 $app = $event->getApplication();77 $app->setLocked(true);78 $this->em->flush();79 }80 public function sendEmailToUserOnWithdrawnApp(ApplicationEvent $event)81 {82 $app = $event->getApplication();83 $message = \Swift_Message::newInstance()84 ->setSubject('Application Withdrawn')85 ->setFrom($this->from)86 ->setTo($app->getUser()->getEmail())87 ->setBody(88 $this->twig->render(89 'AdminBundle:Emails:applicationWithdrawn.html.twig',90 array( 'app' => $app )91 ),92 'text/html'93 );94 $this->mailer->send($message);95 }96 public function sendEmailToAdminOnWithdrawnApp(ApplicationEvent $event)97 {98 $app = $event->getApplication();99 $message = \Swift_Message::newInstance()100 ->setSubject('Application Withdrawn - #'.$app->getId())101 ->setFrom($this->from)102 ->setTo($this->adminemail)103 ->setBody(104 $this->twig->render(105 'AdminBundle:Emails:applicationWithdrawnToAdmin.html.twig',106 array( 'app' => $app )107 ),108 'text/html'109 );110 $this->mailer->send($message);111 }112 public function sendEmailToUserOnPledgedApp(ApplicationEvent $event)113 {114 $app = $event->getApplication();115 $message = \Swift_Message::newInstance()116 ->setSubject('Application Pledged')117 ->setFrom($this->from)118 ->setTo($app->getUser()->getEmail())119 ->setBody(120 $this->twig->render(121 'AdminBundle:Emails:applicationPledged.html.twig',122 array( 'app' => $app )123 ),124 'text/html'125 );126 $this->mailer->send($message);127 }128 public function sendEmailToAdminOnPledgedApp(ApplicationEvent $event)129 {130 $app = $event->getApplication();131 $message = \Swift_Message::newInstance()132 ->setSubject('Application Pledged - #'.$app->getId())133 ->setFrom($this->from)134 ->setTo($this->adminemail)135 ->setBody(136 $this->twig->render(137 'AdminBundle:Emails:applicationPledgedToAdmin.html.twig',138 array( 'app' => $app )139 ),140 'text/html'141 );142 $this->mailer->send($message);143 }144 public function sendEmailToUserOnWaitingApp(ApplicationEvent $event)145 {146 $app = $event->getApplication();147 $message = \Swift_Message::newInstance()148 ->setSubject('Application Pending: Waiting for Details')149 ->setFrom($this->from)150 ->setTo($app->getUser()->getEmail())151 ->setBody(152 $this->twig->render(153 'AdminBundle:Emails:applicationPending.html.twig',154 array( 'app' => $app )155 ),156 'text/html'157 );158 $this->mailer->send($message);159 }160 public function sendEmailToAdminOnWaitingApp(ApplicationEvent $event)161 {162 $app = $event->getApplication();163 $message = \Swift_Message::newInstance()164 ->setSubject('Application Pending - #'.$app->getId())165 ->setFrom($this->from)166 ->setTo($this->adminemail)167 ->setBody(168 $this->twig->render(169 'AdminBundle:Emails:applicationPendingToAdmin.html.twig',170 array( 'app' => $app )171 ),172 'text/html'173 );174 $this->mailer->send($message);175 }176 public function sendEmailToUserOnApprovedApp(ApplicationEvent $event)177 {178 $app = $event->getApplication();179 $message = \Swift_Message::newInstance()180 ->setSubject('Application Approved')181 ->setFrom($this->from)182 ->setTo($app->getUser()->getEmail())183 ->setBody(184 $this->twig->render(185 'AdminBundle:Emails:applicationApproved.html.twig',186 array( 'app' => $app )187 ),188 'text/html'189 );190 $this->mailer->send($message);191 }192 public function sendEmailToAdminOnApprovedApp(ApplicationEvent $event)193 {194 $app = $event->getApplication();195 $message = \Swift_Message::newInstance()196 ->setSubject('Application Approved - #'.$app->getId())197 ->setFrom($this->from)198 ->setTo($this->adminemail)199 ->setBody(200 $this->twig->render(201 'AdminBundle:Emails:applicationApprovedToAdmin.html.twig',202 array( 'app' => $app )203 ),204 'text/html'205 );206 $this->mailer->send($message);207 }208 public function sendEmailToUserOnRejectedApp(ApplicationEvent $event)209 {210 $app = $event->getApplication();211 $message = \Swift_Message::newInstance()212 ->setSubject('Application Rejected')213 ->setFrom($this->from)214 ->setTo($app->getUser()->getEmail())215 ->setBody(216 $this->twig->render(217 'AdminBundle:Emails:applicationRejected.html.twig',218 array( 'app' => $app )219 ),220 'text/html'221 );222 $this->mailer->send($message);223 }224 public function sendEmailToAdminOnRejectedApp(ApplicationEvent $event)225 {226 $app = $event->getApplication();227 $message = \Swift_Message::newInstance()228 ->setSubject('Application Rejected - #' .$app->getId())229 ->setFrom($this->from)230 ->setTo($this->adminemail)231 ->setBody(232 $this->twig->render(233 'AdminBundle:Emails:applicationRejectedToAdmin.html.twig',234 array( 'app' => $app )235 ),236 'text/html'237 );238 $this->mailer->send($message);239 }240}...
RegistMailBuilder.class.php
Source:RegistMailBuilder.class.php
...44 {45 $this->mBuilder->setTemplate();46 $this->mBuilder->setToUsers($this->mUser, $this->mUserConfig);47 $this->mBuilder->setFromEmail($this->mXoopsConfig);48 $this->mBuilder->setSubject($this->mUser, $this->mXoopsConfig);49 $this->mBuilder->setBody($this->mUser, $this->mXoopsConfig);50 }51}5253/***54 * @internal55 * This class is a builder for User_UserRegistMailDirector and the base class,56 * and the base class for other builders. Use register.tpl as the template.57 * That's the first mail at procedure of the user registration, and written58 * about the special URL which activates the registration application.59 */60class User_RegistUserActivateMailBuilder61{62 var $mMailer;63 64 function User_RegistUserActivateMailBuilder()65 {66 $this->mMailer =& getMailer();67 $this->mMailer->useMail();68 }6970 /***71 * Set the template itself.72 */73 function setTemplate()74 {75 $root=&XCube_Root::getSingleton();76 $language = $root->mContext->getXoopsConfig('language');77 $this->mMailer->setTemplateDir(XOOPS_ROOT_PATH . '/modules/user/language/' . $language . '/mail_template/');78 $this->mMailer->setTemplate('register.tpl');79 }8081 function setToUsers($user, $userConfig)82 {83 $this->mMailer->setToUsers($user);84 }85 86 function setFromEmail($xoopsConfig)87 {88 $this->mMailer->setFromEmail($xoopsConfig['adminmail']);89 $this->mMailer->setFromName($xoopsConfig['sitename']);90 }91 92 function setSubject($user, $xoopsConfig)93 {94 $this->mMailer->setSubject(@sprintf(_MD_USER_LANG_USERKEYFOR, $user->getShow('uname')));95 }9697 function setBody($user,$xoopsConfig)98 {99 $this->mMailer->assign('SITENAME', $xoopsConfig['sitename']);100 $this->mMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);101 $this->mMailer->assign('SITEURL', XOOPS_URL . '/');102 $this->mMailer->assign('USERACTLINK', XOOPS_URL . '/user.php?op=actv&uid=' . $user->getVar('uid') . '&actkey=' . $user->getShow('actkey'));103 }104 105 function &getResult()106 {107 return $this->mMailer;108 }109}110111/***112 * @internal113 * This class is a builder which uses adminactivate.tpl as the template. The114 * mail which this class builds, requests activating the new registration for115 * administrators.116 */117class User_RegistUserAdminActivateMailBuilder extends User_RegistUserActivateMailBuilder118{119 function setTemplate()120 {121 $root=&XCube_Root::getSingleton();122 $language = $root->mContext->getXoopsConfig('language');123 $this->mMailer->setTemplateDir(XOOPS_ROOT_PATH . '/modules/user/language/' . $language . '/mail_template/');124 $this->mMailer->setTemplate('adminactivate.tpl');125 }126127 function setToUsers($user, $userConfig)128 {129 $memberHandler=&xoops_gethandler('member');130 $this->mMailer->setToGroups($memberHandler->getGroup($userConfig['activation_group']));131 }132 133 function setFromUser($xoopsConfig)134 {135 $this->mMailer->setFromEmail($xoopsConfig['adminmail']);136 $this->mMailer->setFromName($xoopsConfig['sitename']);137 }138 139 function setSubject($user, $xoopsConfig)140 {141 $this->mMailer->setSubject(@sprintf(_MD_USER_LANG_USERKEYFOR,$user->getVar('uname')));142 }143144 function setBody($user, $xoopsConfig)145 {146 parent::setBody($user,$xoopsConfig);147 $this->mMailer->assign('USERNAME', $user->getVar('uname'));148 $this->mMailer->assign('USEREMAIL', $user->getVar('email'));149 $this->mMailer->assign('USERACTLINK', XOOPS_URL . '/user.php?op=actv&uid=' . $user->getVar('uid') . '&actkey=' . $user->getVar('actkey'));150 }151}152153/***154 * @internal155 * [Notice]156 * Uncompleted?157 * 158 * @todo Implement setTemplate()159 */160class User_RegistUserNotifyMailBuilder extends User_RegistUserActivateMailBuilder161{162 function setTemplate()163 {164 }165166 function setToUsers($user, $userConfig)167 {168 $memberHandler=&xoops_gethandler('member');169 $this->mMailer->setToGroups($memberHandler->getGroup($userConfig['new_user_notify_group']));170 }171 172 function setSubject($user, $xoopsConfig)173 {174 $this->mMailer->setSubject(@sprintf(_MD_USER_LANG_NEWUSERREGAT, $xoopsConfig['sitename']));175 }176177 function setBody($user, $xoopsConfig)178 {179 $this->mMailer->setBody(@sprintf(_MD_USER_LANG_HASJUSTREG, $user->getVar('uname')));180 }181}182183/***184 * @internal185 * This class is a builder which uses activated.tpl as the template. The mail186 * which this class builds, reports completed activation for a new user.187 */188class User_RegistAdminCommitMailBuilder extends User_RegistUserActivateMailBuilder189{190 function setTemplate()191 {192 $root=&XCube_Root::getSingleton();193 $language = $root->mContext->getXoopsConfig('language');194 $this->mMailer->setTemplateDir(XOOPS_ROOT_PATH . '/modules/user/language/' . $language . '/mail_template/');195 $this->mMailer->setTemplate('activated.tpl');196 }197 198 function setSubject($user, $xoopsConfig)199 {200 $this->mMailer->setSubject(@sprintf(_MD_USER_LANG_YOURACCOUNT, $xoopsConfig['sitename']));201 }202}203
...
setSubject
Using AI Code Generation
1require_once 'mailer.php';2$mail = new Mailer();3$mail->setSubject('Test mail');4echo $mail->getSubject();5require_once 'mailer.php';6$mail = new Mailer();7$mail->setSubject('Test mail');8echo $mail->getSubject();9require_once 'mailer.php';10$mail = new Mailer();11$mail->setSubject('Test mail');12echo $mail->getSubject();13require_once 'mailer.php';14$mail = new Mailer();15$mail->setSubject('Test mail');16echo $mail->getSubject();17require_once 'mailer.php';18$mail = new Mailer();19$mail->setSubject('Test mail');20echo $mail->getSubject();21require_once 'mailer.php';22$mail = new Mailer();23$mail->setSubject('Test mail');24echo $mail->getSubject();25require_once 'mailer.php';26$mail = new Mailer();27$mail->setSubject('Test mail');28echo $mail->getSubject();29require_once 'mailer.php';30$mail = new Mailer();31$mail->setSubject('Test mail');32echo $mail->getSubject();33require_once 'mailer.php';34$mail = new Mailer();35$mail->setSubject('Test mail');36echo $mail->getSubject();37require_once 'mailer.php';38$mail = new Mailer();39$mail->setSubject('Test mail');40echo $mail->getSubject();41require_once 'mailer.php';42$mail = new Mailer();43$mail->setSubject('Test mail');44echo $mail->getSubject();
setSubject
Using AI Code Generation
1require_once 'mailer.php';2$mail = new Mailer;3$mail->setSubject('Sample Subject');4echo $mail->getSubject();5require_once 'mailer.php';6$mail = new Mailer;7$mail->setBody('Sample Body');8echo $mail->getBody();9require_once 'mailer.php';10$mail = new Mailer;11$mail->setSubject('Sample Subject');12$mail->setBody('Sample Body');13$mail->send();14require_once 'mailer.php';15$mail = new Mailer;16$mail->setSubject('Sample Subject');17$mail->setBody('Sample Body');18$mail->send();19require_once 'mailer.php';20$mail = new Mailer;21$mail->setSubject('Sample Subject');22$mail->setBody('Sample Body');23$mail->send();24require_once 'mailer.php';25$mail = new Mailer;26$mail->setSubject('Sample Subject');27$mail->setBody('Sample Body');28$mail->send();29require_once 'mailer.php';30$mail = new Mailer;31$mail->setSubject('Sample Subject');32$mail->setBody('Sample Body');33$mail->send();34require_once 'mailer.php';35$mail = new Mailer;36$mail->setSubject('Sample Subject');37$mail->setBody('Sample Body');38$mail->send();39require_once 'mailer.php';40$mail = new Mailer;41$mail->setSubject('Sample Subject');42$mail->setBody('Sample Body');43$mail->send();44require_once 'mailer.php';45$mail = new Mailer;46$mail->setSubject('Sample Subject');47$mail->setBody('Sample Body');48$mail->send();49require_once 'mailer.php';
setSubject
Using AI Code Generation
1require_once 'mailer.php';2$mailer = new Mailer();3$mailer->setSubject('Subject line of the mail');4require_once 'mailer.php';5$mailer = new Mailer();6$mailer->setBody('Body of the mail');7include_once 'mailer.php';8$mailer = new Mailer();9$mailer->setSubject('Subject line of the mail');10include_once 'mailer.php';11$mailer = new Mailer();12$mailer->setBody('Body of the mail');13Recommended Posts: PHP | include_once() Function14PHP | require_once() Function15PHP | include() Function16PHP | require() Function17PHP | include() vs require()18PHP | include() vs include_once()19PHP | require() vs require_once()20PHP | include() vs require() vs include_once() vs require_once()21PHP | include() vs include_once() vs require() vs require_once()22PHP | include() vs include_once() vs require() vs require_once() with example23PHP | include() vs include_once() vs require() vs require
setSubject
Using AI Code Generation
1require_once 'mailer.php';2$mailer = new mailer();3$mailer->setSubject("Welcome to the world of PHP");4echo $mailer->getSubject();5require_once 'mailer.php';6$mailer = new mailer();7$mailer->setBody("Welcome to the world of PHP");8echo $mailer->getBody();9require_once 'mailer.php';10$mailer = new mailer();11$mailer->setSender("Welcome to the world of PHP");12echo $mailer->getSender();13require_once 'mailer.php';14$mailer = new mailer();15$mailer->setRecipient("Welcome to the world of PHP");16echo $mailer->getRecipient();17require_once 'mailer.php';18$mailer = new mailer();19$mailer->setHeader("Welcome to the world of PHP");20echo $mailer->getHeader();21require_once 'mailer.php';22$mailer = new mailer();23$mailer->send("Welcome to the world of PHP");24require_once 'mailer.php';25$mailer = new mailer();26$mailer->send("Welcome to the world of PHP");27require_once 'mailer.php';28$mailer = new mailer();29$mailer->send("Welcome to the world of PHP");30require_once 'mailer.php';31$mailer = new mailer();32$mailer->send("Welcome to the world of PHP");33require_once 'mailer.php';34$mailer = new mailer();35$mailer->send("Welcome to the world of PHP");36require_once 'mailer.php';37$mailer = new mailer();38$mailer->send("Welcome to the world of PHP");
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Execute automation tests with setSubject on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.
Test now for FreeGet 100 minutes of automation test minutes FREE!!