本文整理汇总了PHP中Campaign::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Campaign::get方法的具体用法?PHP Campaign::get怎么用?PHP Campaign::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Campaign
的用法示例。
在下文中一共展示了Campaign::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sending
/**
* Email sending method
*
* @param integer $campaign Campaign ID
* @param string $email Recipient's email
*
* @return void
* @static
**/
public static function sending(int $campaign, string $email)
{
// campaign data
$campaign = new Campaign($campaign);
// recipient data
$query = Core::query('contact-by-email');
$query->bindValue(':coord', $email);
$query->execute();
$data = $query->fetch(PDO::FETCH_NUM);
$person = new People($data[0]);
unset($data);
$mail = $campaign->get('mail');
$replace = array('mail-optout.php?test' => 'mail-optout.php?email=' . md5($email));
$mail = strtr($mail, $replace);
$to = array(array('email' => $email, 'name' => $person->display_name(), 'type' => 'to'));
$message = array('html' => $mail, 'subject' => $campaign->get('objet'), 'from_email' => Configuration::read('mail.sender.mail'), 'from_name' => Configuration::read('mail.sender.name'), 'headers' => array('Reply-To' => Configuration::read('mail.replyto')), 'to' => $to, 'track_opens' => true, 'auto_text' => true, 'subaccount' => Configuration::read('client'));
$async = true;
$mandrill = Configuration::read('mail');
$result = $mandrill->messages->send($message, $async);
// we parse mail sending result
$result = $result[0];
// we save result data
$query = Core::query('tracking-update');
$query->bindValue(':campaign', $campaign->get('id'), PDO::PARAM_INT);
$query->bindValue(':email', $result['email']);
$query->bindValue(':id', $result['_id']);
$query->bindValue(':status', $result['status']);
$query->bindValue(':reject', $result['reject_reason']);
$query->execute();
}
示例2: array
<?php
/**
* Envoi d'une campagne de SMS
*
* PHP version 5
*
* @category Ajax
* @package LeQG
* @author Damien Senger <hi@hiwelo.co>
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
* @link http://leqg.info
*/
$campagne = array('titre' => $_GET['titre'], 'message' => $_GET['message']);
$campaign = Campaign::create('sms');
$campaign = new Campaign($campaign);
$campaign->update('titre', $campagne['titre']);
$campaign->update('message', $campagne['message']);
$var = $_GET;
$var['criteres'] = trim($var['criteres'], ';');
$campaign->addRecipients(People::listing($var, 0, false));
echo $campaign->get('id');
示例3: md5
<?php
// On met en place la protection
User::protection(5);
// On récupère les informations sur la campagne demandée
$campaign = new Campaign($_GET['campagne']);
// On charge le template
Core::loadHeader();
?>
<h2 class="titreCampagne" data-campagne="<?php
echo $campaign->get('id');
?>
" data-page="campagne"><?php
if (!empty($campaign->get('titre'))) {
echo $campaign->get('titre');
} else {
echo 'Campagne sans titre';
}
?>
</h2>
<div class="colonne demi gauche">
<section class="contenu demi">
<h4>Informations annexes</h4>
<ul class="informations">
<li class="fichier">
<span>Fichier de publipostage</span>
<span><a href="exports/publi-<?php
echo md5($campaign->get('id'));
示例4: array
* @category Ajax
* @package LeQG
* @author Damien Senger <hi@hiwelo.co>
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
* @link http://leqg.info
*/
$campagne = array('titre' => $_GET['titre'], 'message' => $_GET['message']);
$campaign = Campaign::create('publi');
$campaign = new Campaign($campaign);
$campaign->update('titre', $campagne['titre']);
$campaign->update('message', $campagne['message']);
$var = $_GET;
$var['criteres'] = trim($var['criteres'], ';');
$contacts = People::listing($var, 0, false);
$fichier = array();
$nomFichier = 'publi-' . md5($campaign->get('id')) . '.csv';
$file = fopen('exports/' . $nomFichier, 'w+');
$entete = array('nom', 'nom_usage', 'prenoms', 'numero', 'rue', 'cp', 'ville', 'pays', 'origine');
fputcsv($file, $entete, ';', '"');
foreach ($contacts as $contact) {
$person = new People($contact);
$address = $person->postal_array();
if (isset($address['reel'])) {
$address = $address['reel'];
$origine = 'declaree';
} else {
$address = $address['officiel'];
$origine = 'liste-electorale';
}
$_fichier = array($person->get('nom'), $person->get('nom_usage'), $person->get('prenoms'), $address['building'], $address['street'], $address['zipcode'], $address['city'], $address['country'], $origine);
if (fputcsv($file, $_fichier, ';', '"')) {
示例5: array
case 'copieTemplate':
$data->templateCopy($_GET['template']);
break;
case 'modificationSMSCampagne':
$data->update('message', $_POST['message']);
break;
case 'updateTracking':
$data->trackingUpdate();
break;
case 'test':
$data->testing();
Core::goPage('campagne', array('id' => $_GET['id']), true);
break;
}
}
Configuration::write('tpl.actuel', $data->get('type'));
Core::loadHeader();
if ($data->get('type') == 'email') {
?>
<h2 id="titre-campagne" <?php
if ($data->get('status') == 'open') {
?>
class="titre"<?php
}
?>
data-campagne="<?php
$data->get('id');
?>
"><?php
if (!empty($data->get('objet'))) {
echo 'Campagne « ' . $data->get('objet') . ' »';
示例6: showall
function showall()
{
if (!$this->checkLogin()) {
redirect('admin/campaigns/login');
}
$cs = new Campaign();
$cs->get();
foreach ($cs->all as $c) {
echo $c->name;
}
}
示例7: array
?>
<li>
<a href="<?php
Core::goPage('publi', array('campagne' => $element['id']));
?>
" class="nostyle"><h4><?php
if (!empty($element['titre'])) {
echo $element['titre'];
} else {
echo 'Campagne sans titre';
}
?>
</h4></a>
<p>
Cette campagne de publipostage a été envoyée à <strong><?php
echo number_format($campaign->get('count'), 0, ',', ' ');
?>
</strong> contact<?php
if ($campaign->get('count') > 1) {
?>
s<?php
}
?>
.<br>
Elle a été préparée le <strong><?php
echo strftime('%d %B %Y', strtotime($campaign->get('date')));
?>
</strong> par <em><?php
echo User::getLoginByID($campaign->get('user'));
?>
</em>.