Ejemplo n.º 1
0
 /**
  * @author Okan CIRAN
  * @ parametre olarak verilen user a onay emaili gönderir. !!
  * @version v 1.0  23.05.2016
  * @param array | null $args
  * @return array
  * @throws \PDOException
  */
 public function sendMailConsultant($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         //print_r(dirname(__FILE__));
         //print_r($_SERVER['DOCUMENT_ROOT']);
         /**
          * Template engine kullanım örneği
          */
         //$foil = \Foil\engine(['folders' => [$_SERVER['DOCUMENT_ROOT'].'/vendor/foil']]);
         //echo $foil->render('test');
         $mailTemplate = new \Utill\Mail\Template\MailTemplate();
         $mailTemplate->setContentRetrieverStartegyClass(new \Utill\Mail\Template\ContentRetrieverFromFileStrategy());
         $mailTemplate->setTemplateContent(array('fileName' => 'kume_confirm'));
         //$message = $mailTemplate->getTemplateContent();
         $message = $mailTemplate->replaceAndGetTemplateContent(array('{[herkimse]}' => 'asd sdsdf', '{[kume]}' => 'OSSA', '{[rol]}' => 'URGE', '{[link]}' => 'https://zeynel.sanalfabrika.com/ostim/sanalfabrika/signupconfirmation?key=zfdkxoyyyzdMphRk1a'));
         $mail = new \Utill\Mail\PhpMailer\PhpMailInfoWrapper();
         $mail->setCharset('UTF-8');
         $mail->setSMTPServerHost('mail.ostimteknoloji.com');
         $mail->setSMTPServerUser('*****@*****.**');
         $mail->setSMTPServerUserPassword('1q2w3e4r');
         $mail->setFromUserName('*****@*****.**');
         $mail->setMessage($message);
         $params = ['subject' => 'Sanal Fabrika Danışman Onay İşlemi', 'info' => 'Sanal Fabrika Yöneticileri tarafından ' . '              sisteme danışman olarak onaylanmanız amacıyla gönderilmiştir', 'to' => '*****@*****.**'];
         // 311corner82@gmail.com
         $mail->sendInfoMailSMTP($params);
         $sql = "";
         $statement = $pdo->prepare($sql);
         //  echo debugPDO($sql, $params);
         // $statement->execute();
         $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
         $errorInfo = $statement->errorInfo();
         if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
             throw new \PDOException($errorInfo[0]);
         }
         return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => $result);
     } catch (\PDOException $e) {
         //$debugSQLParams = $statement->debugDumpParams();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }
 /**
  * @author Okan CIRAN
  * @ parametre olarak verilen user a onay emaili gönderir. !!
  * @version v 1.0  01.09.2016
  * @param array | null $args
  * @return array
  * @throws \PDOException
  */
 public function sendMailUrgeNewPerson($params = array())
 {
     try {
         $pdo = $this->slimApp->getServiceManager()->get('pgConnectFactory');
         $mailTemplate = new \Utill\Mail\Template\MailTemplate();
         $mailTemplate->setContentRetrieverStartegyClass(new \Utill\Mail\Template\ContentRetrieverFromFileStrategy());
         $mailTemplate->setTemplateContent(array('fileName' => 'kume_confirm'));
         $message = $mailTemplate->replaceAndGetTemplateContent(array('{[herkimse]}' => $params['herkimse'], '{[kume]}' => $params['kume'], '{[rol]}' => $params['rol'], '{[link]}' => 'https://zeynel.sanalfabrika.com/ostim/sanalfabrika/signupconfirmation?key=' . $params['key']));
         $mail = new \Utill\Mail\PhpMailer\PhpMailInfoWrapper();
         $mail->setCharset('UTF-8');
         $mail->setSMTPServerHost('mail.ostimteknoloji.com');
         $mail->setSMTPServerUser('*****@*****.**');
         $mail->setSMTPServerUserPassword('1q2w3e4r');
         $mail->setFromUserName('*****@*****.**');
         $mail->setMessage($message);
         $params = ['subject' => 'Sanal Fabrika Küme Çalışanı Onay İşlemi', 'info' => 'Sanal Fabrika Yöneticileri tarafından ' . '              sisteme Küme Çalışanı olarak onaylanmanız amacıyla gönderilmiştir', 'to' => '*****@*****.**'];
         //$params['auth_email'] ];  // 311corner82@gmail.com
         $mail->sendInfoMailSMTP($params);
         $sql = "";
         $statement = $pdo->prepare($sql);
         //  echo debugPDO($sql, $params);
         // $statement->execute();
         $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
         $errorInfo = $statement->errorInfo();
         if ($errorInfo[0] != "00000" && $errorInfo[1] != NULL && $errorInfo[2] != NULL) {
             throw new \PDOException($errorInfo[0]);
         }
         return array("found" => true, "errorInfo" => $errorInfo, "resultSet" => $result);
     } catch (\PDOException $e) {
         //$debugSQLParams = $statement->debugDumpParams();
         return array("found" => false, "errorInfo" => $e->getMessage());
     }
 }