Beispiel #1
0
 public function form()
 {
     $this->views = new Views(new Template("admin"));
     Phalanx::loadClasses('Mailing');
     $this->views->data = Mailing::get($this->get->id);
     $this->views->display('mailing_form.phtml');
 }
 public function sendNotifications()
 {
     $all_email_notifications = Profile::getAllUserEmailNotifications();
     foreach ($all_email_notifications as $data) {
         Mailing::notifications($data);
     }
     echo 'Script Completed';
 }
 private function sendActivation($user_id, $email)
 {
     $token = Tools::hash($email);
     $url = Tools::generateUrl(['activate_account', $token]);
     $user = User::findOrFail($user_id);
     $user->activate_token = $token;
     $user->save();
     Mailing::activate($email, $url);
 }
Beispiel #4
0
 /**
  * Display a listing of destinos
  *
  * @return Response
  */
 public function postIndex()
 {
     if (Input::has('email') && Input::get('email')) {
         $check = Mailing::where('email', '=', Input::get('email'))->first();
         if (!$check) {
             $mailing = new Mailing();
             $mailing->email = Input::get('email');
             $mailing->nome = Input::get('nome');
             $mailing->phone = Input::get('phone');
             $mailing->save();
             return Redirect::back()->with('success', array('Você foi registrado no Mailing.'));
         } else {
             return Redirect::back()->with('danger', array('Você ja esta registrado no mailing.'));
         }
     } else {
         return Redirect::back()->with('danger', array('Seu email esta incorreto.'));
     }
 }
 public function send()
 {
     $data = Input::all();
     $rules = ['full_name' => ['required', 'min:3', 'max:35'], 'email' => ['required', 'email'], 'content' => ['required', 'min:10', 'max:600']];
     $validator = Validator::make($data, $rules);
     if ($validator->fails()) {
         return Alert::formError($validator);
     }
     Mailing::contact($data);
     return Alert::flash(Lang::get('contact.sent'), 'success');
 }
Beispiel #6
0
 public function fire($job, $data)
 {
     $file = Config::get('projeter.upload_path') . $data['file'];
     Log::info("Starting to add {$data['target']} to database (File: {$file})");
     $target = new Target();
     $target->name = $data['target'];
     $target->save();
     $reader = new \EasyCSV\Reader($file);
     // There must be a Email field in CSV file
     /*if(!in_array('Email', $reader->getHeaders() ))
     		throw new Exception("Email field not found", 1);*/
     while ($row = $reader->getRow()) {
         Log::info("Adding {$row['Email']} to the target {$data['target']}");
         $mailing = new Mailing();
         $mailing->target()->associate($target);
         $mailing->email = $row['Email'];
         $mailing->save();
     }
     Log::info("Mailing list {$target->name} added to database");
     $job->delete();
 }
 public function reportPost($id)
 {
     $check_tracking = Post::checkPostTracking($id);
     $post = Post::where('id', $id)->firstOrFail();
     $email = '*****@*****.**';
     $slug = $post['slug'];
     if ($check_tracking) {
         Session::flash('failure', Lang::get('post.report-sent-already'));
     } else {
         Mailing::reportpost($email, $post);
         if (Auth::check()) {
             $userid = Auth::id();
             Post::trackReportPost($post, $userid);
         } else {
             Post::trackReportPost($post);
         }
         Session::flash('success', Lang::get('post.report-sent'));
     }
     return Redirect::to('post/' . $id . '/' . $slug);
 }
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new Mailing($info[self::ID]);
         parent::resgatarObjetos($info);
         $temp->setTexto($info[parent::TEXTO]);
         $temp->setStatus($info[self::STATUS]);
         $temp->setData(new DataHora($info[self::DATA]));
         $lPM = new ListaPacoteMailings();
         $lPM->condicoes('', $info[self::PACOTE], ListaPacoteMailings::ID);
         if ($lPM->getTotal() > 0) {
             $temp->setPacote($lPM->listar());
         }
         return $temp;
     }
 }
Beispiel #9
0
	print '</td>';
	// Title
	print '<td class="liste_titre">';
	print '<input type="text" class="flat" name="sall" value="'.$sall.'" size="40">';
	print '</td>';
	print '<td class="liste_titre">&nbsp;</td>';
	if (! $filteremail) print '<td class="liste_titre">&nbsp;</td>';
	print '<td class="liste_titre">&nbsp;</td>';
	print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
	print "</td>";
	print "</tr>\n";
	print '</form>';

	$var=True;

	$email=new Mailing($db);

	while ($i < min($num,$conf->liste_limit))
	{
		$obj = $db->fetch_object($result);

		$var=!$var;

		print "<tr $bc[$var]>";
		print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/fiche.php?id='.$obj->rowid.'">';
		print img_object($langs->trans("ShowEMail"),"email").' '.stripslashes($obj->rowid).'</a></td>';
		print '<td>'.$obj->titre.'</td>';
		// Date creation
		print '<td align="center">';
		print dol_print_date($db->jdate($obj->datec),'day');
		print '</td>';
<?php

if (isset($_POST['submit'])) {
    require 'include/config.php';
    require 'include/class.mailing.php';
    $n = new Mailing($db);
    $n->Insert($_POST);
    Misc::Redirect('mailing_list.php');
}
include 'include/top.php';
?>

<form method="post">
	<p>
		<label><span>Title</span></label>
		<input type="text" name="title" id="title" placeholder="Enter mailing list title" />
	</p>
<!--	<p>
		<label><span>List ID</span></label>
		<input type="text" name="list_id" id="list_id" placeholder="Enter mailing list id" />
	</p>
	<p>
		<label><span>URL</span></label>
		<input type="text" name="url" id="url" placeholder="Enter list url" />
	</p>-->
<!--
	<p>
		<label><span>Autoresponder</span></label>
		<select name="type">
			<option value="getresponse">GetResponse</option>
			<option value="infusionsoft">InfusionSoft</option>
 public function addV6($fname, $lname, $email, $role, $gender, $password)
 {
     APP::import('Model', 'User');
     $this->User = new User();
     // Includes
     App::import('Lib', 'Strings');
     App::import('Lib', 'Mailing');
     App::uses('Folder', 'Utility');
     App::uses('File', 'Utility');
     $strings = new Strings();
     // Check if the username already exists
     $user = $this->User->findByEmail($email);
     if (count($user) > 0) {
         $this->Session->setFlash(__('Prière de vous authentifier afin de continuer votre candidature.'), 'custom-flash-danger-go-back');
         $this->redirect(array('controller' => 'login', 'action' => 'login'));
         return;
     }
     $encrypted_password = $strings->Encript($password);
     // Create user
     $this->User->create();
     $this->User->set('fname', $fname);
     $this->User->set('lname', $lname);
     $this->User->set('password', $encrypted_password);
     $this->User->set('email', $email);
     $this->User->set('role_id', $role);
     $this->User->set('gender_id', $gender);
     $this->User->save();
     // Send E-mail
     $mailer = new Mailing();
     $mailer->UserAccountCreation($email, '', $fname, $lname, $email, $password, $role);
     return $this->User->getLastInsertID();
 }
Beispiel #12
0
if (!$sortorder) {
    $sortorder = "ASC";
}
if (!$sortfield) {
    $sortfield = "email";
}
$id = GETPOST('id', 'int');
$rowid = GETPOST('rowid', 'int');
$action = GETPOST("action");
$search_lastname = GETPOST("search_lastname");
$search_firstname = GETPOST("search_firstname");
$search_email = GETPOST("search_email");
$search_dest_status = GETPOST('search_dest_status');
// Search modules dirs
$modulesdir = dolGetModulesDirs('/mailings');
$object = new Mailing($db);
/*
 * Actions
 */
if ($action == 'add') {
    $module = GETPOST("module");
    $result = -1;
    $var = true;
    foreach ($modulesdir as $dir) {
        // Load modules attributes in arrays (name, numero, orders) from dir directory
        //print $dir."\n<br>";
        dol_syslog("Scan directory " . $dir . " for modules");
        // Loading Class
        $file = $dir . "/" . $module . ".modules.php";
        $classname = "mailing_" . $module;
        if (file_exists($file)) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/emailing.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/comm/mailing/class/mailing.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
$langs->load("mails");
if (!$user->rights->mailing->lire || empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->societe_id > 0) {
    accessforbidden();
}
$id = GETPOST('mailid', 'int') ? GETPOST('mailid', 'int') : GETPOST('id', 'int');
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$urlfrom = GETPOST('urlfrom');
$object = new Mailing($db);
$result = $object->fetch($id);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('mailingcard'));
// Array of possible substitutions (See also file mailing-send.php that should manage same substitutions)
$object->substitutionarray = array('__ID__' => 'IdRecord', '__EMAIL__' => 'EMail', '__LASTNAME__' => 'Lastname', '__FIRSTNAME__' => 'Firstname', '__MAILTOEMAIL__' => 'TagMailtoEmail', '__OTHER1__' => 'Other1', '__OTHER2__' => 'Other2', '__OTHER3__' => 'Other3', '__OTHER4__' => 'Other4', '__OTHER5__' => 'Other5', '__SIGNATURE__' => 'TagSignature', '__CHECK_READ__' => 'TagCheckMail', '__UNSUBSCRIBE__' => 'TagUnsubscribe');
if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_SECURITY_TOKEN)) {
    $object->substitutionarray['__SECUREKEYPAYPAL__'] = 'SecureKeyPaypal';
    if (!empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) {
        $object->substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = 'SecureKeyPaypalUniquePerMember';
    }
}
$object->substitutionarrayfortest = array('__ID__' => 'TESTIdRecord', '__EMAIL__' => 'TESTEMail', '__LASTNAME__' => 'TESTLastname', '__FIRSTNAME__' => 'TESTFirstname', '__MAILTOEMAIL__' => 'TESTMailtoEmail', '__OTHER1__' => 'TESTOther1', '__OTHER2__' => 'TESTOther2', '__OTHER3__' => 'TESTOther3', '__OTHER4__' => 'TESTOther4', '__OTHER5__' => 'TESTOther5', '__SIGNATURE__' => $user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN) ? $user->signature : '', '__CHECK_READ__' => 'TagCheckMail', '__UNSUBSCRIBE__' => 'TagUnsubscribe');
Beispiel #14
0
    print '<td align="center">' . $langs->trans("DateCreation") . '</td>';
    print '<td align="center">' . $langs->trans("NbOfEMails") . '</td>';
    print '<td align="right"><a href="' . DOL_URL_ROOT . '/comm/mailing/liste.php">' . $langs->trans("AllEMailings") . '</a></td></tr>';
    $num = $db->num_rows($result);
    if ($num > 0) {
        $var = true;
        $i = 0;
        while ($i < $num) {
            $obj = $db->fetch_object($result);
            $var = !$var;
            print "<tr {$bc[$var]}>";
            print '<td nowrap="nowrap"><a href="fiche.php?id=' . $obj->rowid . '">' . img_object($langs->trans("ShowEMail"), "email") . ' ' . $obj->rowid . '</a></td>';
            print '<td>' . dol_trunc($obj->titre, 38) . '</td>';
            print '<td align="center">' . dol_print_date($obj->date_creat, 'day') . '</td>';
            print '<td align="center">' . ($obj->nbemail ? $obj->nbemail : "0") . '</td>';
            $mailstatic = new Mailing($db);
            print '<td align="right">' . $mailstatic->LibStatut($obj->statut, 5) . '</td>';
            print '</tr>';
            $i++;
        }
    } else {
        print '<tr><td>' . $langs->trans("None") . '</td></tr>';
    }
    print "</table><br>";
    $db->free($result);
} else {
    dol_print_error($db);
}
print '</td></tr>';
print '</table>';
$db->close();
Beispiel #15
0
'__OTHER3__' => 'TESTOther3',
'__OTHER4__' => 'TESTOther4',
'__OTHER5__' => 'TESTOther5'
);


// Action clone object
if ($_POST["action"] == 'confirm_clone' && $_POST['confirm'] == 'yes')
{
	if (empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
	{
		$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
	}
	else
	{
		$object=new Mailing($db);
		$result=$object->createFromClone($_REQUEST['id'],$_REQUEST["clone_content"],$_REQUEST["clone_receivers"]);
		if ($result > 0)
		{
			header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
			exit;
		}
		else
		{
			$mesg=$object->error;
			$_GET['action']='';
			$_GET['id']=$_REQUEST['id'];
		}
	}
}
 private function sendReturnReceipt()
 {
     $mail = new Mailing();
     $mail->setMailTo($this->email);
     $mail->setSubject(PAYPALRECEIPTSUBJECT);
     $body = PAYPALRECEIPTBODY;
     $body = str_replace("<time>", $this->transactionTime, $body);
     $body = str_replace("<id>", $this->transactionID, $body);
     $body = str_replace("<amount>", $this->amount, $body);
     $mail->setBody($body);
     $mail->send();
 }
 /**
  * Remove the specified mailing from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $mailing = Mailing::find($id);
     $mailing->delete();
     return Redirect::to('admin/mailing/')->with('success', array('Registro deletado.'));
 }
Beispiel #18
0
<?php

importar("Utilidades.Publicidades.Mailing.Lista.ListaMailings");
importar("Utilidades.Publicidades.Mailing.Lista.ListaPacoteMailings");
$tituloPagina = 'Utilidades > Publicidades > Mailings > Criar';
$iTCM = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaUtilidades/mailing.html"));
if (!empty($_POST)) {
    $erro = '';
    if (empty($_POST['assunto'])) {
        $erro = "<b>Assunto</b> não preenchido!<br><br>";
    } elseif (empty($_POST['pacote'])) {
        $erro = "<b>Pacote</b> não escolhido!<br><br>";
    }
    if (empty($erro)) {
        $sC = new Mailing();
        $sC->getTexto()->titulo = $_POST['assunto'];
        $sC->getTexto()->texto = $_POST['mensagem'];
        $lPM = new ListaPacoteMailings();
        $lPM->condicoes('', $_POST['pacote'], ListaPacoteMailings::ID);
        $sC->setPacote($lPM->listar());
        $lS = new ListaMailings();
        $lS->inserir($sC);
        $_POST = '';
        $javaScript .= Aviso::criar("Mailing salva com sucesso!");
    } else {
        $javaScript .= Aviso::criar($erro);
    }
}
$iTCM->trocar("linkVoltar", "?p=" . $_GET['p'] . "&a=listarMailings");
$lPM = new ListaPacoteMailings();
$iTCM->createRepeticao("repetir->PacoteMailings");
Beispiel #19
0
<script type="text/javascript">
	setTimeout( function() {
		location.href = '<?php 
    echo $link;
    ?>
';
	}, 100);
</script>
<?php 
} else {
    require 'include/class.mailing.php';
    require 'include/class.settings.php';
    $settings = new Settings($db);
    $interval = $settings->getSetting('autosub_interval');
    $lists = explode(",", $product['auto_subscribe_lists']);
    $m = new Mailing($db);
    $lists = $m->getMailingsById($lists);
    $outHtml = "";
    $outScript = "";
    ?>
	<script type="text/javascript">
		var totalFrames = <?php 
    echo count($lists);
    ?>
;
		var loadedFrames = 0;
		var started = false;
		var pauseInterval = <? echo $interval['value']; ?>;
		
		function loadFrame(f) {
			if (started) {
Beispiel #20
0
 private static function criarListaParaEnvio(Mailing $m)
 {
     if ($m->getId() != '' && $m->getPacote()->getId() != '') {
         $m->getPacote()->getEmails()->setParametros(0);
         $con = BDConexao::__Abrir();
         $con->executar("DELETE FROM " . Sistema::$BDPrefixo . "mailing_pacotes_envio WHERE mailing = '" . $m->getId() . "'");
         while ($rs = $m->getPacote()->getEmails()->listar()) {
             $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "mailing_pacotes_envio(mailing, email) VALUES('" . $m->getId() . "','" . $rs['email'] . "')");
         }
         $m->getPacote()->getEmails()->setParametros(0);
     }
 }
<?php

require 'include/config.php';
require 'include/class.mailing.php';
$n = new Mailing($db);
$nets = $n->getMailings();
include 'include/top.php';
?>

<table class="tablesorter">
	<thead>
		<tr>
			<th>ID</th>
			<th>Title</th>
			<th>List ID</th>
			<th>URL</th>
			<th>Autoresponder</th>
		</tr>
	</thead>
	<tbody>
		<?php 
foreach ($nets as $net) {
    ?>

			<tr>
				<td><?php 
    echo $net['id'];
    ?>
</td>
				<td><a href="mailing_edit.php?id=<?php 
    echo $net['id'];
Beispiel #22
0
 /**
  *	Load an object from its id and create a new one in database
  *
  *	@param  int		$fromid     	Id of object to clone
  *	@param	int		$option1		1=Copy content, 0=Forget content
  *	@param	int		$option2		Not used
  *	@return	int						New id of clone
  */
 function createFromClone($fromid, $option1, $option2)
 {
     global $user, $langs;
     $error = 0;
     $object = new Mailing($this->db);
     $object->context['createfromclone'] = 'createfromclone';
     $this->db->begin();
     // Load source object
     $object->fetch($fromid);
     $object->id = 0;
     $object->statut = 0;
     // Clear fields
     $object->titre = $langs->trans("CopyOf") . ' ' . $object->titre . ' ' . dol_print_date(dol_now());
     // If no option copy content
     if (empty($option1)) {
         // Clear values
         $object->nbemail = 0;
         $object->sujet = '';
         $object->body = '';
         $object->bgcolor = '';
         $object->bgimage = '';
         $object->email_from = '';
         $object->email_replyto = '';
         $object->email_errorsto = '';
         $object->user_creat = $user->id;
         $object->user_valid = '';
         $object->date_creat = '';
         $object->date_valid = '';
         $object->date_envoi = '';
     }
     // Create clone
     $result = $object->create($user);
     // Other options
     if ($result < 0) {
         $this->error = $object->error;
         $error++;
     }
     if (!$error) {
         //Clone target
         if (!empty($option2)) {
             require_once DOL_DOCUMENT_ROOT . '/core/modules/mailings/modules_mailings.php';
             $mailing_target = new MailingTargets($this->db);
             $target_array = array();
             $sql = "SELECT fk_contact, ";
             $sql .= " lastname,   ";
             $sql .= " firstname,";
             $sql .= " email,";
             $sql .= " other,";
             $sql .= " source_url,";
             $sql .= " source_id ,";
             $sql .= " source_type ";
             $sql .= " FROM " . MAIN_DB_PREFIX . "mailing_cibles ";
             $sql .= " WHERE fk_mailing = " . $fromid;
             dol_syslog(get_class($this) . "::createFromClone", LOG_DEBUG);
             $result = $this->db->query($sql);
             if ($result) {
                 if ($this->db->num_rows($result)) {
                     while ($obj = $this->db->fetch_object($result)) {
                         $target_array[] = array('fk_contact' => $obj->fk_contact, 'lastname' => $obj->lastname, 'firstname' => $obj->firstname, 'email' => $obj->email, 'other' => $obj->other, 'source_url' => $obj->source_url, 'source_id' => $obj->source_id, 'source_type' => $obj->source_type);
                     }
                 }
             } else {
                 $this->error = $this->db->lasterror();
                 return -1;
             }
             $mailing_target->add_to_target($object->id, $target_array);
         }
     }
     unset($object->context['createfromclone']);
     // End
     if (!$error) {
         $this->db->commit();
         return $object->id;
     } else {
         $this->db->rollback();
         return -1;
     }
 }
Beispiel #23
0
 *		\brief      Page with log information for emailing
 */
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/comm/mailing/class/mailing.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/emailing.lib.php';
$langs->load("mails");
// Security check
if (!$user->rights->mailing->lire || $user->societe_id > 0) {
    accessforbidden();
}
/*
 * View
 */
llxHeader('', $langs->trans("Mailing"), 'EN:Module_EMailing|FR:Module_Mailing|ES:M&oacute;dulo_Mailing');
$form = new Form($db);
$mil = new Mailing($db);
if ($mil->fetch($_REQUEST["id"]) >= 0) {
    $head = emailing_prepare_head($mil);
    dol_fiche_head($head, 'info', $langs->trans("Mailing"), 0, 'email');
    print '<table width="100%"><tr><td>';
    $mil->user_creation = $mil->user_creat;
    $mil->date_creation = $mil->date_creat;
    $mil->user_validation = $mil->user_valid;
    $mil->date_validation = $mil->date_valid;
    dol_print_object_info($mil);
    print '</td></tr></table>';
    print '</div>';
}
llxFooter();
$db->close();
Beispiel #24
0
 /**
  *	Load an object from its id and create a new one in database
  *
  *	@param  int		$fromid     	Id of object to clone
  *	@param	int		$option1		1=Copy content, 0=Forget content
  *	@param	int		$option2		Not used
  *	@return	int						New id of clone
  */
 function createFromClone($fromid, $option1, $option2)
 {
     global $user, $langs;
     $error = 0;
     $object = new Mailing($this->db);
     $this->db->begin();
     // Load source object
     $object->fetch($fromid);
     $object->id = 0;
     $object->statut = 0;
     // Clear fields
     $object->titre = $langs->trans("CopyOf") . ' ' . $object->titre . ' ' . dol_print_date(dol_now());
     // If no option copy content
     if (empty($option1)) {
         // Clear values
         $object->nbemail = 0;
         $object->sujet = '';
         $object->body = '';
         $object->bgcolor = '';
         $object->bgimage = '';
         $object->email_from = '';
         $object->email_replyto = '';
         $object->email_errorsto = '';
         $object->user_creat = $user->id;
         $object->user_valid = '';
         $object->date_creat = '';
         $object->date_valid = '';
         $object->date_envoi = '';
     }
     // Create clone
     $result = $object->create($user);
     // Other options
     if ($result < 0) {
         $this->error = $object->error;
         $error++;
     }
     if (!$error) {
     }
     // End
     if (!$error) {
         $this->db->commit();
         return $object->id;
     } else {
         $this->db->rollback();
         return -1;
     }
 }
<?php

require 'include/config.php';
require 'include/class.mailing.php';
$n = new Mailing($db);
if (isset($_POST['submit'])) {
    $n->Edit($_POST);
    Misc::Redirect('mailing_list.php');
}
if (isset($_POST['submitdelete'])) {
    $n->Delete($_POST['id']);
    Misc::Redirect('mailing_list.php');
}
include 'include/top.php';
$s = $n->getMailing($_GET['id']);
?>

<form method="post">
	<input type="hidden" id="hidden" name="id" value="<?php 
echo $s['id'];
?>
" />
	<p>
		<label><span>Title</span></label>
		<input type="text" name="title" id="title" placeholder="Enter mailing list title" value="<?php 
echo $s['title'];
?>
" />
	</p>
	<p>
		<label><span>List ID</span></label>
		<label><span>Custom parameter</span></label>
		<input type="text" name="parameter" id="parameter" placeholder="parameter=value"  value="<?php 
echo $pr['parameter'];
?>
" />
	</p>
	<p>
		<label><span>Auto subscribe</span></label>
		<input type="checkbox" name="auto_subscribe_enabled" value="1" <?php 
if ($pr['auto_subscribe_enabled'] == '1') {
    echo 'checked="checked"';
}
?>
 /> Enable auto subscribe <br />
		<?php 
$m = new Mailing($db);
$ms = $m->getMailings();
$mailings = array();
foreach ($ms as $mal) {
    $mailings[$mal['type']][] = $mal;
}
foreach ($mailings as $network => $lists) {
    ?>

			<fieldset>
				<legend><?php 
    echo ucfirst($network);
    ?>
</legend>
				<input type="radio" name="auto_subscribe_lists[<?php 
    echo $network;
Beispiel #27
0
<?php

require_once 'handlers/Mailing.php';
/*
*  TESTING CODEE!!
*  
*/
$subject = 'Test mailing';
$body = 'test body';
$address = array('*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**');
$mailing = new Mailing($address);
$mailing->subject = 'Test mailing';
$mailing->body = 'test body';
if ($mailing->is_init) {
    echo 'Sending emails...<br>';
    $report = $mailing->send();
    echo 'Emails sent!<br>';
    echo 'Additional information:<br>';
    echo $mailing->getErrorMessage();
    var_dump($report);
} else {
    echo $mailing->getErrorMessage() . '<br>';
}