當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Campaign::mailOut方法代碼示例

本文整理匯總了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;
        }
    }
}
開發者ID:swat30,項目名稱:safeballot,代碼行數:31,代碼來源:autosender.php

示例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']);
開發者ID:swat30,項目名稱:safeballot,代碼行數:67,代碼來源:Campaigns.php


注:本文中的Campaign::mailOut方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。