示例#1
0
<?php

/** 
 * Secret Santa Bot (Manual Example)
 * 
 * Obviously you don't need to use the frontend to get this whole thing to work.
 * This is a stripped down example.  
 *
 * @author      Ben Watts
 * @url         http://www.benwatts.ca/
 * @version     x
 * @date        Dec 06, 2009
 *
 */
require_once 'lib/SecretSantaBot.php';
$people = array(array("name" => "ben", "email" => "*****@*****.**"), array("name" => "priya", "email" => "*****@*****.**"), array("name" => "nathan", "email" => "*****@*****.**"), array("name" => "mike", "email" => "*****@*****.**"), array("name" => "nick", "email" => "*****@*****.**"));
$ss = new SecretSantaBot($people, true);
// <-- set to false and it will attempt to send emails.
$ss->sendEmails();
示例#2
0
/** 
 * Email people
 */
function runEmail()
{
    $people = prepPeopleArray();
    try {
        $ss = new SecretSantaBot($people, false);
        $ss->sendEmails();
    } catch (Exception $e) {
        echo '<p class="error"><strong>Error:</strong> ' . $e->getMessage() . '</p>';
    }
}