How to use setContentType method of mailer class

Best Atoum code snippet using mailer.setContentType

Email.class.php

Source:Email.class.php Github

copy

Full Screen

...21 if ($vrac->isRectificative()) {22 $subject .= ' RECTIFIE';23 }24 $body = $this->getBodyFromPartial('vrac_saisie_terminee', array('vrac' => $vrac, 'etablissement' => $etablissement));25 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');26 return $this->getMailer()->send($message);27 }28 public function vracDemandeValidation($vrac, $etablissement, $destinataire, $acteur)29 {30 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));31 $from = $this->getFromEmailInterpros($interpros);32 $to = array($destinataire);33 $subject = 'Demande de validation d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);34 if ($vrac->isRectificative()) {35 $subject .= ' RECTIFIE';36 }37 $body = $this->getBodyFromPartial('vrac_demande_validation', array('vrac' => $vrac, 'etablissement' => $etablissement, 'acteur' => $acteur));38 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');39 return $this->getMailer()->send($message);40 }41 public function vracDemandeValidationInterpro($vrac, $destinataire, $acteur)42 {43 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));44 $from = $this->getFromEmailInterpros($interpros);45 $to = array($destinataire);46 $subject = 'Demande de validation d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);47 if ($vrac->isRectificative()) {48 $subject .= ' RECTIFIE';49 }50 $body = $this->getBodyFromPartial('vrac_demande_validation_interpro', array('vrac' => $vrac, 'acteur' => $acteur));51 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');52 return $this->getMailer()->send($message);53 }54 public function dsnegoceuploadSend($ds, $etablissement, $destinataire)55 {56 $interpros = array(InterproClient::getInstance()->getById($etablissement->interpro));57 $from = $this->getFromEmailInterpros($interpros);58 $to = array($destinataire);59 $subject = 'DS Négoce du '.$etablissement->identifiant;60 $body = $this->getBodyFromPartial('dsnegoceupload_send', array('ds' => $ds, 'etablissement' => $etablissement));61 $message = Swift_Message::newInstance()62 ->setFrom($from)63 ->setTo($to)64 ->setSubject($subject)65 ->setBody($body)66 ->setContentType('text/html')67 ->attach(Swift_Attachment::fromPath($ds->getAttachmentUri(current($ds->getFichiers()))));68 return $this->getMailer()->send($message);69 }70 public function daeErrorFileSend($path, $etablissement)71 {72 $interpro = InterproClient::getInstance()->getById($etablissement->interpro);73 $from = $this->getFromEmailInterpros(array($interpro));74 $to = array($interpro->email_technique);75 $subject = 'DeclarVins | Erreur d\'import du fichier de commercialisation pour '.$etablissement->identifiant;76 $body = $this->getBodyFromPartial('dae_error_file_send', array('etablissement' => $etablissement));77 $message = Swift_Message::newInstance()78 ->setFrom($from)79 ->setTo($to)80 ->setSubject($subject)81 ->setBody($body)82 ->setContentType('text/html')83 ->attach(Swift_Attachment::fromPath($path));84 return $this->getMailer()->send($message);85 }86 public function vracContratValide($vrac, $etablissement, $destinataire)87 {88 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));89 $from = $this->getFromEmailInterpros($interpros);90 $to = array($destinataire);91 $subject = 'Validation du contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);92 $body = $this->getBodyFromPartial('vrac_contrat_valide', array('vrac' => $vrac, 'etablissement' => $etablissement));93 $message = Swift_Message::newInstance()94 ->setFrom($from)95 ->setTo($to)96 ->setSubject($subject)97 ->setBody($body)98 ->setContentType('text/html')99 ->attach(Swift_Attachment::fromPath(sfConfig::get('sf_cache_dir').'/pdf/'.$vrac->get('_id').'.pdf'));100 return $this->getMailer()->send($message);101 }102 public function vracTransaction($vrac, $etablissement, $oioc, $cc)103 {104 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));105 $from = $this->getFromEmailInterpros($interpros);106 $to = array($oioc->email_transaction);107 $subject = 'Envoi de votre DECLARATION DE TRANSACTION à votre OIOC';108 $body = $this->getBodyFromPartial('vrac_transaction', array('vrac' => $vrac, 'etablissement' => $etablissement, 'oioc' => $oioc));109 $message = Swift_Message::newInstance()110 ->setFrom($from)111 ->setTo($to)112 ->setCc($cc)113 ->setReplyTo($cc)114 ->setSubject($subject)115 ->setBody($body)116 ->setContentType('text/html')117 ->attach(Swift_Attachment::fromPath(sfConfig::get('sf_cache_dir').'/pdf/'.$vrac->get('_id').'-TRANSACTION.pdf'));118 return $this->getMailer()->send($message);119 }120 public function vracContratModifie($vrac, $etablissement, $destinataire)121 {122 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));123 $from = $this->getFromEmailInterpros($interpros);124 $to = array($destinataire);125 $subject = 'Modification d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);126 $body = $this->getBodyFromPartial('vrac_contrat_modifie', array('vrac' => $vrac, 'etablissement' => $etablissement));127 $message = Swift_Message::newInstance()128 ->setFrom($from)129 ->setTo($to)130 ->setSubject($subject)131 ->setBody($body)132 ->setContentType('text/html')133 ->attach(Swift_Attachment::fromPath(sfConfig::get('sf_cache_dir').'/pdf/'.$vrac->get('_id').'.pdf'));134 return $this->getMailer()->send($message);135 }136 public function vracContratValideInterpro($vrac, $destinataire)137 {138 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));139 $from = $this->getFromEmailInterpros($interpros);140 $to = array($destinataire);141 $subject = 'Validation d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);142 $body = $this->getBodyFromPartial('vrac_contrat_valide_interpro', array('vrac' => $vrac));143 $message = Swift_Message::newInstance()144 ->setFrom($from)145 ->setTo($to)146 ->setSubject($subject)147 ->setBody($body)148 ->setContentType('text/html')149 ->attach(Swift_Attachment::fromPath(sfConfig::get('sf_cache_dir').'/pdf/'.$vrac->get('_id').'.pdf'));150 return $this->getMailer()->send($message);151 }152 public function vracContratValidation($vrac, $etablissement, $destinataire)153 {154 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));155 $from = $this->getFromEmailInterpros($interpros);156 $to = array($destinataire);157 $subject = 'Votre validation a bien été prise en compte';158 $body = $this->getBodyFromPartial('vrac_contrat_validation', array('vrac' => $vrac, 'etablissement' => $etablissement));159 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');160 return $this->getMailer()->send($message);161 }162 public function vracContratAnnulation($vrac, $etablissement, $acteur, $destinataire)163 {164 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));165 $from = $this->getFromEmailInterpros($interpros);166 $to = array($destinataire);167 $subject = 'Annulation d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);168 $body = $this->getBodyFromPartial('vrac_contrat_annulation', array('vrac' => $vrac, 'etablissement' => $etablissement, 'acteur' => $acteur));169 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');170 return $this->getMailer()->send($message);171 }172 public function vracTransactionAnnulation($vrac, $etablissement, $oioc, $destinataire)173 {174 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));175 $from = $this->getFromEmailInterpros($interpros);176 $to = array($destinataire);177 $subject = 'Annulation d\'une DECLARATION DE TRANSACTION à votre OIOC';178 $body = $this->getBodyFromPartial('vrac_transaction_annulation', array('vrac' => $vrac, 'etablissement' => $etablissement, 'oioc' => $oioc));179 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');180 return $this->getMailer()->send($message);181 }182 public function vracDemandeAnnulation($vrac, $etab, $etablissement, $destinataire, $acteur)183 {184 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));185 $from = $this->getFromEmailInterpros($interpros);186 $to = array($destinataire);187 $subject = 'Demande d\'annulation d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);188 if ($vrac->isRectificative()) {189 $subject .= ' RECTIFIE';190 }191 $body = $this->getBodyFromPartial('vrac_demande_annulation', array('vrac' => $vrac, 'etab' => $etab, 'etablissement' => $etablissement, 'acteur' => $acteur));192 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');193 return $this->getMailer()->send($message);194 }195 public function vracRefusAnnulation($vrac, $etab, $etablissement, $destinataire, $acteur)196 {197 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));198 $from = $this->getFromEmailInterpros($interpros);199 $to = array($destinataire);200 $subject = 'Refus d\'annulation d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);201 if ($vrac->isRectificative()) {202 $subject .= ' RECTIFIE';203 }204 $body = $this->getBodyFromPartial('vrac_refus_annulation', array('vrac' => $vrac, 'etab' => $etab, 'etablissement' => $etablissement, 'acteur' => $acteur));205 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');206 return $this->getMailer()->send($message);207 }208 public function vracDemandeAnnulationInterpro($vrac, $etab, $etablissement, $destinataire, $acteur)209 {210 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));211 $from = $this->getFromEmailInterpros($interpros);212 $to = array($destinataire);213 $subject = 'Demande d\'annulation d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);214 if ($vrac->isRectificative()) {215 $subject .= ' RECTIFIE';216 }217 $body = $this->getBodyFromPartial('vrac_demande_annulation_interpro', array('vrac' => $vrac, 'etab' => $etab, 'etablissement' => $etablissement, 'acteur' => $acteur));218 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');219 return $this->getMailer()->send($message);220 }221 public function vracRelanceContrat($vrac, $etablissement, $destinataire, $acteur, $url)222 {223 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));224 $from = $this->getFromEmailInterpros($interpros);225 $to = array($destinataire);226 $subject = 'Relance : Demande de validation d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);227 $body = $this->getBodyFromPartial('vrac_contrat_relance', array('vrac' => $vrac, 'etablissement' => $etablissement, 'acteur' => $acteur, 'url' => $url));228 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');229 return $this->getMailer()->send($message);230 }231 public function vracExpirationContrat($vrac, $etablissement, $destinataire, $acteur, $url)232 {233 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));234 $from = $this->getFromEmailInterpros($interpros);235 $to = array($destinataire);236 $subject = 'Suppression d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true).' suite au dépassement du délai';237 $body = $this->getBodyFromPartial('vrac_contrat_expiration', array('vrac' => $vrac, 'etablissement' => $etablissement, 'acteur' => $acteur, 'url' => $url));238 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');239 return $this->getMailer()->send($message);240 }241 public function vracExpirationAnnulationContrat($vrac, $etablissement, $destinataire, $acteur, $url)242 {243 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));244 $from = $this->getFromEmailInterpros($interpros);245 $to = array($destinataire);246 $subject = 'Suppression de l\'annulation d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true).' suite au dépassement du délai';247 $body = $this->getBodyFromPartial('vrac_contrat_expiration_annulation', array('vrac' => $vrac, 'etablissement' => $etablissement, 'acteur' => $acteur, 'url' => $url));248 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');249 return $this->getMailer()->send($message);250 }251 public function vracDeterminationPrix($vrac, $etablissement, $destinataire, $acteur, $url)252 {253 $interpros = array(InterproClient::getInstance()->getById($vrac->interpro));254 $from = $this->getFromEmailInterpros($interpros);255 $to = array($destinataire);256 $subject = 'Relance : Demande du prix définitif d\'un contrat interprofessionnel '.$vrac->getLibelleProduit("%c% %a%", true);257 $body = $this->getBodyFromPartial('vrac_determination_prix', array('vrac' => $vrac, 'etablissement' => $etablissement, 'acteur' => $acteur, 'url' => $url));258 $message = Swift_Message::newInstance()259 ->setFrom($from)260 ->setTo($to)261 ->setCc($from)262 ->setSubject($subject)263 ->setBody($body)264 ->setContentType('text/html');265 return $this->getMailer()->send($message);266 }267 public function vracRelanceFromDRM($drm, $details, $destinataire)268 {269 $interpros = array();270 foreach ($details as $detail) {271 $interpros[$detail->interpro] = InterproClient::getInstance()->getById($detail->interpro);272 }273 $from = $this->getFromEmailInterpros($interpros);274 $to = array($destinataire);275 $subject = (count($details) > 1)? 'Contrats interprofessionnel manquants sur la DRM '.$drm->getMois().'/'.$drm->getAnnee() : 'Contrat interprofessionnel manquant sur la DRM '.$drm->getMois().'/'.$drm->getAnnee();276 $body = $this->getBodyFromPartial('vrac_relance_from_drm', array('drm' => $drm, 'details' => $details));277 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');278 return $this->getMailer()->send($message);279 }280 public function sendContratMandat($contrat, $destinataire, $interpros = null)281 {282 $from = $this->getFromEmailInterpros($interpros,true);283 $to = array($destinataire);284 $subject = 'Contrat d\'inscription DeclarVins';285 $body = $this->getBodyFromPartial('send_contrat_mandat', array('contrat' => $contrat));286 $message = Swift_Message::newInstance()287 ->setFrom($from)288 ->setTo($to)289 ->setSubject($subject)290 ->setBody($body)291 ->setContentType('text/html')292 ->attach(Swift_Attachment::fromPath(sfConfig::get('sf_cache_dir').'/pdf/'.$contrat->get('_id').'.pdf'));293 if ($contrat->needAvenant()) {294 $message->attach(Swift_Attachment::fromPath(sfConfig::get('sf_data_dir').'/inscription/avenant-oco.pdf'));295 }296 return $this->getMailer()->send($message);297 }298 public function sendConventionCiel($convention, $destinataire, $interpros = null, $contrat = null)299 {300 $from = $this->getFromEmailInterpros($interpros,true);301 $to = array($destinataire);302 $subject = 'Convention d\'adhésion à l\'échange de données CIEL-Declarvins.net';303 $body = $this->getBodyFromPartial('send_convention_ciel', array('convention' => $convention));304 $message = Swift_Message::newInstance()305 ->setFrom($from)306 ->setTo($to)307 ->setSubject($subject)308 ->setBody($body)309 ->setContentType('text/html')310 ->attach(Swift_Attachment::fromPath(sfConfig::get('sf_data_dir').'/convention-ciel/pdf/'.$convention->get('_id').'.pdf'));311 return $this->getMailer()->send($message);312 }313 public function sendCompteRegistration($compte, $destinataire)314 {315 $interpros = array();316 foreach ($compte->interpro as $id => $values) {317 $interpros[] = InterproClient::getInstance()->find($id);318 }319 $from = $this->getFromEmailInterpros($interpros,true);320 $to = array($destinataire);321 $subject = 'Activation de votre compte sur Declarvins.net';322 $numeroContrat = explode('-', $compte->contrat);323 $numeroContrat = $numeroContrat[1];324 $body = $this->getBodyFromPartial('send_compte_registration', array('numero_contrat' => $numeroContrat));325 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');326 return $this->getMailer()->send($message);327 }328 public function sendRedefinitionMotDePasse($compte, $destinataire, $logins)329 {330 $interpros = array();331 foreach ($compte->interpro as $id => $values) {332 $interpros[] = InterproClient::getInstance()->find($id);333 }334 $from = $this->getFromEmailInterpros($interpros,true);335 $to = array($destinataire);336 $subject = 'Redéfinition du mot de passe';337 $body = $this->getBodyFromPartial('send_redefinition_mot_de_passe', array('compte' => $compte, 'logins' => $logins));338 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');339 return $this->getMailer()->send($message);340 }341 public function sendCielAssistance($datas, $etablissement, $interpro = null)342 {343 $from = $this->getFromEmailInterpros(array($interpro),true);344 if ($interpro->identifiant == 'CIVP') {345 $to = $interpro->email_contrat_inscription;346 } else {347 $to = $interpro->email_assistance_ciel;348 }349 $subject = $etablissement->identifiant.' | '.$datas['sujet'];350 $body = $this->getBodyFromPartial('send_assistance_ciel', array('datas' => $datas));351 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');352 return $this->getMailer()->send($message);353 }354 public function cielSended($drm)355 {356 $etablissement = $drm->getEtablissement();357 $compte = $etablissement->getCompteObject();358 if (!$compte->email) {359 return null;360 }361 $from = $this->getFromEmailInterpros(array($etablissement->getInterproObject()),true);362 $to = array($compte->email);363 $subject = "Confirmation de l'envoi de votre DRM à CIEL";364 $body = $this->getBodyFromPartial('ciel_sended', array('drm' => $drm, 'etablissement' => $etablissement));365 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');366 return $this->getMailer()->send($message);367 }368 public function cielRappel($drm)369 {370 $etablissement = $drm->getEtablissement();371 $compte = $etablissement->getCompteObject();372 if (!$compte->email) {373 return null;374 }375 $interpro = $etablissement->getInterproObject();376 $from = $this->getFromEmailInterpros(array($interpro),true);377 $to = array($compte->email, $interpro->email_contrat_inscription);378 $subject = "Rappel validation de votre DRM sur CIEL";379 $body = $this->getBodyFromPartial('ciel_rappel', array('drm' => $drm, 'etablissement' => $etablissement));380 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');381 $message->addBcc(sfConfig::get('app_email_to_notification'));382 return $this->getMailer()->send($message);383 }384 public function cielRectificative($drm, $diffs, $interpro)385 {386 $etablissement = $drm->getEtablissement();387 $compte = $etablissement->getCompteObject();388 if (!$compte->email) {389 return null;390 }391 $from = $this->getFromEmailInterpros(array($etablissement->getInterproObject()),true);392 $to = array($compte->email);393 $subject = "Modification de votre DRM sur CIEL";394 $body = $this->getBodyFromPartial('ciel_rectificative', array('drm' => $drm, 'diffs' => $diffs, 'etablissement' => $etablissement));395 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');396 if ($interpro) {397 $cc = array($interpro->email_contrat_inscription);398 if ($interpro->identifiant == 'CIVP') {399 $cc[] = $interpro->email_assistance_ciel;400 }401 $message->setCc($cc);402 }403 return $this->getMailer()->send($message);404 }405 public function cielValide($drm)406 {407 $etablissement = $drm->getEtablissement();408 $compte = $etablissement->getCompteObject();409 if (!$compte->email) {410 return null;411 }412 $from = $this->getFromEmailInterpros(array($etablissement->getInterproObject()),true);413 $to = array($compte->email);414 $subject = "Validation de votre DRM sur CIEL";415 $body = $this->getBodyFromPartial('ciel_valide', array('drm' => $drm, 'etablissement' => $etablissement));416 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');417 return $this->getMailer()->send($message);418 }419 public function volumesSurveilles($drm, $volumes, $interpro)420 {421 $from = $this->getFromEmailInterpros(array($interpro),true);422 $to = array($interpro->email_contrat_inscription);423 $subject = "DeclarVins // DRM - Volumes surveillés";424 $body = $this->getBodyFromPartial('volumes_surveilles', array('drm' => $drm, 'volumes' => $volumes));425 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');426 return $this->getMailer()->send($message);427 }428 public function prixNonCoherent($vrac)429 {430 $interpro = $vrac->getProduitInterpro();431 if (!$interpro) {432 return;433 }434 $from = $this->getFromEmailInterpros(array($interpro),true);435 $to = array($interpro->email_contrat_inscription);436 $subject = "DeclarVins // Contrat vrac - Prix non coherent";437 $body = $this->getBodyFromPartial('prix_non_coherent', array('vrac' => $vrac));438 $message = $this->getMailer()->compose($from, $to, $subject, $body)->setContentType('text/html');439 return $this->getMailer()->send($message);440 }441 protected function getMailer()442 {443 return $this->_context->getMailer();444 }445 protected function getBodyFromPartial($partial, $vars = null)446 {447 return $this->_context->getController()->getAction('Email', 'main')->getPartial('Email/' . $partial, $vars);448 }449 protected function getFromEmailInterpros($interpros = array(), $isInscription = false) {450 $referente = InterproClient::getInstance()->getById(InterproClient::INTERPRO_REFERENTE);451 if(!(count($interpros) > 0)){452 return (!$isInscription)? array($referente->email_contrat_vrac => $referente->nom) : array($referente->email_contrat_inscription => $referente->nom);...

Full Screen

Full Screen

Mailer.php

Source:Mailer.php Github

copy

Full Screen

...43 $mail->setFrom(array($this->from => $this->name))44 ->setTo($to)45 ->setSubject("Nouvelle Action")46 ->setBody($this->templating->render('OrangeMainBundle:Notification:nouvelleAction.html.twig', array('data' => $data)))47 ->setContentType('text/html')48 ->setCharset('utf-8');49 if($this->debug){50 $mail->setBcc($this->bcc);51 } 52 return $this->mailer->send($mail);53 }54 55 /**56 * @param array $to57 * @param array $copy58 * @param \Orange\MainBundle\Entity\Tache $tache59 */60 public function notifNewTache($to, $copy, $tache) {61 $mail = \Swift_Message::newInstance();62 $manager = $tache->getActionCyclique()->getAction()->getPorteur()->getSuperior();63 $mail->setFrom(array($this->from => $this->name))64 ->setTo($to)65 ->setBcc(array('madiagne.sylla@orange-sonatel.com','fatoukine.ndao@orange-sonatel.com'))66 ->setSubject("Nouvelle tache")67 ->setBody($this->templating->render('OrangeMainBundle:Notification:nouvelleTache.html.twig', array('tache' => $tache)))68 ->setContentType('text/html')69 ->setCharset('utf-8');70 if($this->debug){71 $mail->setBcc($this->bcc);72 } 73 if($manager) {74 $copy = array_merge($copy, array($manager->getEmail()));75 }76 $mail->setCc($copy);77 return $this->mailer->send($mail);78 }79 80 public function notifNewSignalisation($to, $cc, $data){81 $mail = \Swift_Message::newInstance();82 $mail->setFrom(array($this->from => $this->name))83 ->setTo($to)84 ->setCc($to)85 ->setSubject("Nouvelle Signalisation")86 ->setBody($this->templating->render('OrangeMainBundle:Notification:nouvelleSignalisation.html.twig', array('data' => $data)))87 ->setContentType('text/html')88 ->setCharset('utf-8');89 if($this->debug){90 $mail->setBcc($this->bcc);91 } 92 return $this->mailer->send($mail);93 }94 95 public function notifNewUser($to, $cc, $data){96 $mail = \Swift_Message::newInstance();97 $mail->setFrom(array($this->from => $this->name))98 ->setTo($to)99 ->setCc($cc)100 ->setSubject("Création de compte")101 ->setBody($this->templating->render('OrangeMainBundle:Utilisateur:email.html.twig', array('user' => $data)))102 ->setContentType('text/html')103 ->setCharset('utf-8');104 if($this->debug){105 $mail->setBcc($this->bcc);106 } 107 return $this->mailer->send($mail);108 }109 110 public function send($to, $cc = null, $subject, $body, $trace = false) {111 $mail = \Swift_Message::newInstance();112 $mail->setFrom(array($this->from => $this->name))113 ->setTo($to)114 ->setCc($cc)115 ->setSubject(utf8_encode($subject))116 ->setBody($body)117 ->setContentType('text/html')118 ->setCharset('utf-8');119 if($trace || $this->debug) {120 $mail->setBcc($this->bcc);121 }122 return $this->mailer->send($mail);123 }124 125 public function sendBug($to, $cc = null, $subject, $body, $chemin, $file) {126 $mail = \Swift_Message::newInstance();127 $mail->setFrom(array($this->from => $this->name))128 ->setTo($to)129 ->setCc($cc)130 ->setSubject($subject)131 ->setBody($body)132 ->setContentType('text/html')133 ->setCharset('utf-8') 134 ->attach(\Swift_Attachment::fromPath($chemin.'/'.$file));135 if($this->debug){136 $mail->setBcc($this->bcc);137 }138 return $this->mailer->send($mail);139 }140 141 public function sendNotifReport($to, $report, $user) {142 $mail = \Swift_Message::newInstance();143 $mail->setFrom(array($this->from => $this->name))144 ->setTo($to)145 ->setSubject("Création de reporting")146 ->setBody($this->templating->render('OrangeMainBundle:Notification:notifReporting.html.twig', array('body' => $report, 'user' => $user)))147 ->setContentType('text/html')148 ->setCharset('utf-8');149 if($this->debug){150 $mail->setBcc($this->bcc);151 }152 return $this->mailer->send($mail);153 }154 155 public function sendReport($to, $subject, $file) {156 $mail = \Swift_Message::newInstance();157 $mail->setFrom(array($this->from => $this->name))158 ->setTo($to)159 ->setBcc(array('madiagne.sylla@orange-sonatel.com'))160 ->setSubject($subject)161 ->setBody($this->templating->render('OrangeMainBundle:Notification:reporting.html.twig'))162 ->setContentType('text/html')163 ->setCharset('utf-8') 164 ->attach(\Swift_Attachment::fromPath('./web/upload/reporting/'.$file));165 if($this->debug){166 $mail->setBcc($this->bcc);167 } 168 return $this->mailer->send($mail);169 }170 171 public function sendExtraction($to, $subject, $file) {172 $mail = \Swift_Message::newInstance();173 $mail->setFrom(array($this->from => $this->name))174 ->setTo($to)175 ->setBcc(array('madiagne.sylla@orange-sonatel.com'))176 ->setSubject($subject)177 ->setBody($this->templating->render('OrangeMainBundle:Notification:exportAction.html.twig'))178 ->setContentType('text/html')179 ->setCharset('utf-8')180 ->attach(\Swift_Attachment::fromPath('./web/upload/reporting/'.$file));181 if($this->debug){182 $mail->setBcc($this->bcc);183 } 184 return $this->mailer->send($mail);185 }186 187 public function sendRelanceNewAction($to, $cc, $subject, $body){188 $mail = \Swift_Message::newInstance();189 $mail->setFrom(array($this->from => $this->name))190 ->setTo($to)191 ->setCc($cc)192 ->setSubject($subject)193 ->setBody($this->templating->render('OrangeMainBundle:Relance:relanceNewAction.html.twig', array(194 'url' => $body['accueil_url'], 'action' => $body['action']195 ))196 )->setContentType('text/html')197 ->setCharset('utf-8');198 if($this->debug){199 $mail->setBcc($this->bcc);200 } 201 return $this->mailer->send($mail);202 }203 204 public function registration($user){205 $mail = \Swift_Message::newInstance();206 $mail->setFrom(array($this->from => $this->name))207 ->setTo($user->getEmail())208 ->setSubject('Création de compte')209 ->setBody($this->templating->render('OrangeMainBundle:Utilisateur:registration.html.twig', array('url' => $user)))210 ->setContentType('text/html')211 ->setCharset('utf-8');212 if($this->debug){213 $mail->setBcc($this->bcc);214 } 215 return $this->mailer->send($mail);216 }217 218 public function sendAlerteQuartTime($to, $subject, $body, $trace=false) {219 $mail = \Swift_Message::newInstance();220 $mail->setFrom(array($this->from => $this->name))221 ->setTo($to)222 ->setSubject($subject)223 ->setBody($body)224 ->setContentType('text/html');225 if($trace || $this->debug) {226 $mail->setBcc($this->bcc);227 }228 return $this->mailer->send($mail);229 }230 231 public function sendRappel($to, $cc = null, $subject, $body, $trace=false) {232 $mail = \Swift_Message::newInstance();233 $mail->setFrom(array($this->from => $this->name))234 ->setTo($to)235 ->setCc($cc)236 ->setSubject($subject)237 ->setBody($body)238 ->setContentType('text/html');239 if($trace || $this->debug) {240 $mail->setBcc($this->bcc);241 }242 return $this->mailer->send($mail);243 }244 245 public function NotifActionEspace($to, $cc, $subject, $body) {246 $mail = \Swift_Message::newInstance();247 $mail->setFrom(array($this->from => $this->name))248 ->setTo($to)249 ->setCc($cc)250 ->setSubject(utf8_encode($subject))251 ->setBody($this->templating->render('OrangeMainBundle:Notification:notifActionEspace.html.twig', array('body' => $body)))252 ->setContentType('text/html')253 ->setCharset('utf-8');254 if($this->debug){255 $mail->setBcc($this->bcc);256 }257 return $this->mailer->send($mail);258 }259 260 public function NotifAction($to, $cc, $subject, $body) {261 $mail = \Swift_Message::newInstance();262 $mail->setFrom(array($this->from => $this->name))263 ->setTo($to)264 ->setCc($cc)265 ->setSubject(utf8_encode($subject))266 ->setBody($this->templating->render('OrangeMainBundle:Notification:newAction.html.twig', array('body' => $body)))267 ->setContentType('text/html')268 ->setCharset('utf-8');269 if($this->debug){270 $mail->setBcc($this->bcc);271 } 272 return $this->mailer->send($mail);273 }274 275 public function NotifActionSignalisation($to,$cc,$subject, $body) {276 $mail = \Swift_Message::newInstance();277 $mail->setFrom(array($this->from => $this->name))278 ->setTo($to)279 ->setCc($cc)280 ->setSubject(utf8_encode($subject))281 ->setBody($this->templating->render('OrangeMainBundle:Notification:newAction.html.twig', array('body' => $body)))282 ->setContentType('text/html')283 ->setCharset('utf-8');284 if($this->debug){285 $mail->setBcc($this->bcc);286 } 287 return $this->mailer->send($mail);288 }289 290 public function notifForSignalisation($to, $cc, $subject, $body, $motif=null, $trace=false) {291 $mail = \Swift_Message::newInstance();292 $mail->setFrom(array($this->from => $this->name))293 ->setTo($to)294 ->setCc($cc)295 ->setSubject($subject)296 ->setBody($this->templating->render('OrangeMainBundle:Notification:notifSignalisation.html.twig', array('body' => $body, 'motif' => $motif)))297 ->setContentType('text/html')298 ->setCharset('utf-8');299 if($trace || $this->debug) {300 $mail->setBcc(array('madiagne.sylla@orange-sonatel.com','fatoukine.ndao@orange-sonatel.com'));301 }302 return $this->mailer->send($mail);303 }304 305 public function NotifWithCopy($to, $cc, $subject, $body, $motif=null, $trace=false) {306 $mail = \Swift_Message::newInstance();307 $mail->setFrom(array($this->from => $this->name))308 ->setTo($to)309 ->setCc($cc)310 ->setSubject($subject)311 ->setBody($this->templating->render('OrangeMainBundle:Notification:notif.html.twig', array('body' => $body, 'motif' => $motif)))312 ->setContentType('text/html')313 ->setCharset('utf-8');314 if($trace || $this->debug) {315 $mail->setBcc(array('madiagne.sylla@orange-sonatel.com','fatoukine.ndao@orange-sonatel.com'));316 }317 return $this->mailer->send($mail);318 }319320 public function Notif($to, $subject, $body) {321 $mail = \Swift_Message::newInstance();322 $mail->setFrom(array($this->from => $this->name))323 ->setTo($to)324 ->setSubject(utf8_encode($subject))325 ->setBody($this->templating->render('OrangeMainBundle:Notification:notif.html.twig', array('body' => $body)))326 ->setContentType('text/html')327 ->setCharset('utf-8');328 if($this->debug){329 $mail->setBcc($this->bcc);330 } 331 return $this->mailer->send($mail);332 }333 334 public function NotifUpdatePorteur($to, $data) {335 $mail = \Swift_Message::newInstance();336 $mail->setFrom(array($this->from => $this->name))337 ->setTo($to)338 ->setSubject("Affectation d'une action")339 ->setBody($this->templating->render('OrangeMainBundle:Notification:notifUpdatePorteur.html.twig', array('data' => $data)))340 ->setContentType('text/html')341 ->setCharset('utf-8');342 if($this->debug){343 $mail->setBcc($this->bcc);344 }345 return $this->mailer->send($mail);346 }347 348 public function sendLogsMail($subject, $body,$chemin) {349 $mail = \Swift_Message::newInstance();350 $mail->setFrom(array($this->from => $this->name))351 ->setTo(array("madiagne.sylla@orange-sonatel.com"))352 ->setSubject($subject)353 ->setBody($body)354 ->setContentType('text/html')355 ->setCharset('utf-8')356 ->attach(\Swift_Attachment::fromPath($chemin));357 if($this->debug){358 $mail->setBcc($this->bcc);359 } 360 return $this->mailer->send($mail);361 }362 363 public function notifActionGenerique($to, $cc=null,$subject, $body) {364 $mail = \Swift_Message::newInstance();365 $mail->setFrom(array($this->from => $this->name))366 ->setTo($to)367 ->setCc(null)368 ->setSubject(utf8_encode($subject))369 ->setBody($this->templating->render('OrangeMainBundle:Notification:notifActionGenerique.html.twig', array('body' => $body)))370 ->setContentType('text/html')371 ->setCharset('utf-8');372 if($this->debug){373 $mail->setBcc($this->bcc);374 } 375 return $this->mailer->send($mail);376 }377 ...

Full Screen

Full Screen

setContentType

Using AI Code Generation

copy

Full Screen

1$var = new mailer();2$var->setContentType("text/html");3$var = new mailer();4$var->setContentType("text/html");5$var = new mailer();6$var->setContentType("text/html");7$var = new mailer();8$var->setContentType("text/html");9$var = new mailer();10$var->setContentType("text/html");11$var = new mailer();12$var->setContentType("text/html");13$var = new mailer();14$var->setContentType("text/html");15$var = new mailer();16$var->setContentType("text/html");17$var = new mailer();18$var->setContentType("text/html");19$var = new mailer();20$var->setContentType("text/html");21$var = new mailer();22$var->setContentType("text/html");23$var = new mailer();24$var->setContentType("text/html");25$var = new mailer();26$var->setContentType("text/html");27$var = new mailer();28$var->setContentType("text/html");29$var = new mailer();

Full Screen

Full Screen

setContentType

Using AI Code Generation

copy

Full Screen

1$myMail->setContentType("text/html");2$myMail->send();3$myMail->setContentType("text/plain");4$myMail->send();5$myMail->setContentType("text/html");6$myMail->setContentType("text/plain");7$myMail->send();8$myMail->setContentType("text/plain");9$myMail->setContentType("text/html");10$myMail->send();11$myMail->setContentType("text/html");12$myMail->setContentType("text/html");13$myMail->send();14$myMail->setContentType("text/plain");15$myMail->setContentType("text/plain");16$myMail->send();17$myMail->setContentType("text/html");18$myMail->setContentType("text/plain");19$myMail->setContentType("text/html");20$myMail->send();21$myMail->setContentType("text/plain");22$myMail->setContentType("text/html");23$myMail->setContentType("text/plain");24$myMail->send();25$myMail->setContentType("text/html");26$myMail->setContentType("text/plain");27$myMail->setContentType("text/plain");28$myMail->send();

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Atoum automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Trigger setContentType code on LambdaTest Cloud Grid

Execute automation tests with setContentType on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful