本文整理汇总了PHP中Campaign::mailOut方法的典型用法代码示例。如果您正苦于以下问题:PHP Campaign::mailOut方法的具体用法?PHP Campaign::mailOut怎么用?PHP Campaign::mailOut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Campaign
的用法示例。
在下文中一共展示了Campaign::mailOut方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$debug = false;
if (@$argv[1] == 'debug') {
$debug = true;
}
$results = Database::singleton()->query_fetch_all($sql);
foreach ($results as &$campaign) {
$campaign = new Campaign($campaign['id']);
switch ($campaign->calcStatus(true)) {
case 2:
break;
case 1:
$sql = 'SELECT aut_email FROM auth WHERE aut_agp_id = ' . $campaign->getGroup() . ' LIMIT 1';
$email = Database::singleton()->query_fetch($sql);
$email = $email['aut_email'];
$sql = 'SELECT agp_name FROM auth_groups WHERE agp_id = ' . $campaign->getGroup();
$group = Database::singleton()->query_fetch($sql);
$group = $group['agp_name'];
$campaign->mailOut('votes', $group, $email);
if ($debug) {
echo "Sent " . $campaign->getName() . " emails.\n";
}
default:
$sql = 'UPDATE campaigns SET autosend = 0 WHERE id = ' . $campaign->getId();
$result = Database::singleton()->query($sql);
if ($debug) {
echo "Removed " . $campaign->getName() . "'s autosend.\n";
}
break;
}
}
}
示例2: getAdminInterface
//.........这里部分代码省略.........
return $this->recipTopLevelAdmin();
}
}
return $this->smarty->fetch('admin/campaign_recips_addedit.tpl');
}
return $this->smarty->fetch('../../../cms/templates/error.tpl');
case 'recipcsvup':
if ($this->user->hasPerm('addcampaignrecips')) {
$form = Campaign::getCSVForm();
$this->smarty->assign('form', $form);
if ($form->validate() && $form->isSubmitted() && $_POST['submit']) {
return $this->recipTopLevelAdmin();
}
return $this->smarty->fetch('admin/campaign_csvup.tpl');
}
return $this->smarty->fetch('../../../cms/templates/error.tpl');
case 'recipdelete':
if ($this->user->hasPerm('addcampaignrecips')) {
if (!is_null($_REQUEST['id']) && CampaignUser::exists($_REQUEST['id'])) {
$recipient = new CampaignUser($_REQUEST['id']);
if ($recipient->getGroup() == $this->user->getAuthGroup()) {
$recipient->delete();
unset($_REQUEST['id']);
} else {
return $this->smarty->fetch('../../../cms/templates/error.tpl');
}
}
return $this->recipTopLevelAdmin();
}
return $this->smarty->fetch('../../../cms/templates/error.tpl');
case 'votesend':
if ($this->user->hasPerm('addcampaignrecips')) {
$campaign = new Campaign($_REQUEST['campaign_id']);
return $campaign->mailOut('votes');
}
return 'You do not have permission to perform this action.';
case 'voteprint':
if ($this->user->hasPerm('generatereciplist')) {
$campaign = new Campaign($_REQUEST['campaign_id']);
$campaign->preparePdf();
}
return $this->topLevelAdmin();
case 'resultsend':
if ($this->user->hasPerm('addcampaignrecips')) {
$campaign = new Campaign($_REQUEST['campaign_id']);
return $campaign->mailOut('results');
}
return 'You do not have permission to perform this action.';
case 'listbilling':
if ($this->user->hasPerm('admin')) {
$groups = Group::getGroups();
$this->smarty->assign('groups', $groups);
return $this->smarty->fetch('admin/billing_list.tpl');
}
case 'viewbilling':
if ($this->user->hasPerm('admin')) {
$group = new Group($_REQUEST['group_id']);
$this->smarty->assign('group', $group);
$campaigns = Campaign::getCampaigns($_REQUEST['group_id']);
$campaignsSorted = array_merge($campaigns['upcoming'], $campaigns['progress'], $campaigns['ended']);
$this->smarty->assign('campaigns', $campaignsSorted);
return $this->smarty->fetch('admin/billing_view.tpl');
}
case 'togglestatus':
if ($this->user->hasPerm('admin')) {
$group = new Group($_REQUEST['group_id']);