]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 14 Jan 2014 09:46:02 +0000 (09:46 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 14 Jan 2014 09:46:02 +0000 (09:46 +0000)
inc/commons/class.common.ajax.php
inc/commons/class.common.tools.php

index 2488fcb45524460815d4921c43e8ebe180e534c1..3a78a19f91a7bf3c30b247f8a265789b0b4e2cca 100644 (file)
@@ -381,6 +381,23 @@ SVN : svn+ssh://svn@svn.cubedesigners.com/projects/$svn";
                $x->addAlert('Espace de développement crée. Vous allez recevoir un mail récapitulant les identifiants de l\'espace crée');
        }
 
+       public static function postMailer($args, &$x) {
+               $mail = new CubeIT_Mail_Mailjet();
+               $mail->setFrom($_POST['from']);
+               $to = explode(',', $_POST['to']);
+               foreach ($to as $t) {
+                       $t = trim($t);
+                       if ($t == '') {
+                               continue;
+                       }
+                       $mail->addTo($t);
+               }
+               $mail->setSubject($_POST['subject']);
+               $mail->setBodyHtmlFromZip($_FILES['src']['tmp_name'], ROOT . '/mailer/' . microtime());
+               $transport = new CubeIT_Mail_Transport_Mailjet("ca110b35f8735c223d69c9987c2ac47d", 'b289d0acb08e0fe56ce98ccf0dd1ed8b');
+               $mail->send($transport);
+       }
+
 }
 
 ?>
\ No newline at end of file
index 1fe201f52e103b7d6c88dde7113e2a2dc9924d45..4b88cd9db54cf6f03fdd59f3d24b3e2c65f5f0e6 100644 (file)
@@ -913,6 +913,26 @@ class commonTools {
                return $res;
        }
 
-}
+       public static function mailer() {
+               commonDroits::min(2);
+               global $core;
+               $res = commonPage::barre();
+               $res .= commonPage::tMain();
+               $res .= commonPage::bh();
+               $res.='<form action="postMailer" method="post" enctype="multipart/form-data">';
+               $res.='<table class="liste">';
+               $res.='<tr><th colspan="3"><strong>' . __('Envoi d\'un mailing') . '</strong></th></tr>';
+               $res.='<tr><td>Sources</td><td>' . cubeForm::filehtml('src') . '</td><td>' . __('Fichier contenant les sources html et images du mail') . '</td></tr>';
+               $res.='<tr><td>Sujet</td><td>' . form::field('subject', 50, 512, '[Extranet Mailer] ' . date('Y-m-d H:i')) . '</td><td>' . '</td></tr>';
+               $res.='<tr><td>Expéditeur</td><td>' . form::field('from', 50, 512, $core->user->email) . '</td><td>' . '</td></tr>';
+               $res.='<tr><td>Destinataire(s)</td><td>' . form::field('to', 50, 512, $core->user->email) . '</td><td>' . __('Séparer les adresses par des virgules') . '</td></tr>';
+               $res.='<tr><td class="right" colspan="3"><a href="#" class="submit">' . $core->typo->BoutonOK(__('Envoi')) . '</a></td></td>';
+               $res.='</table>';
+               $res.='</form>';
+               $res .= '</div>';
+               $res .= commonPage::bf();
+               $res .= commonPage::bMain();
+               return $res;
+       }
 
-?>
+}