scheduleBlast() public method

Schedule a mass mail blast
public scheduleBlast ( string $name, string $list, string $schedule_time, string $from_name, string $from_email, string $subject, string $content_html, string $content_text, array $options = [] ) : array
$name string the name to give to this new blast
$list string the mailing list name to send to
$schedule_time string when the blast should send. Dates in the past will be scheduled for immediate delivery. Any English textual datetime format known to PHP's strtotime function is acceptable, such as 2009-03-18 23:57:22 UTC, now (immediate delivery), +3 hours (3 hours from now), or February 14, 9:30 EST. Be sure to specify a timezone if you use an exact time.
$from_name string the name appearing in the "From" of the email
$from_email string The email address to use as the "from" – choose from any of your verified emails
$subject string the subject line of the email
$content_html string the HTML-format version of the email
$content_text string the text-format version of the email
$options array associative array blast_id copy_blast copy_template replyto report_email is_link_tracking is_google_analytics is_public suppress_list test_vars email_hour_range abtest test_percent data_feed_url
return array API result
コード例 #1
0
            if (!isset($_POST[$field]) || !$_POST[$field]) {
                $errors[] = $msg;
            }
        }
        if (!is_numeric($_POST['list'])) {
            $errors[] = 'You must select a list.';
        }
        if ($_POST['schedule_time'] && strtotime($_POST['schedule_time']) == FALSE) {
            $errors[] = 'Invalid schedule time.';
        }
        if (!count($errors)) {
            $lists = sailthru_form::get_all_lists();
            $list = $lists[$_POST['list']];
            require_once 'client/requires.php';
            $client = new Sailthru_Client(get_option('sailthru_api_key'), get_option('sailthru_secret'));
            $r = $client->scheduleBlast($_POST['blast_name'], $list, $_POST['schedule_time'], $_POST['from_name'], $_POST['from_email'], $_POST['subject'], $_POST['content'], $_POST['plaintext_body'], array("report_email" => $_POST['report_email']));
            if ($r['status'] == 'scheduled') {
                $errors[] = 'Your blast has been successfully scheduled for: ' . $r['schedule_time'];
                update_option('triggermail_last_blast', $_POST);
            } else {
                $errors[] = $r['errormsg'];
            }
        }
    } else {
        //no post..
        $_POST = get_option('triggermail_last_blast');
    }
    ?>
				<a href="options-general.php?page=sailthru&action=forms">Edit Forms</a> | Send an Email Blast | <a href="options-general.php?page=sailthru&action=options">General Options</a> | <a href="options-general.php?page=sailthru&action=datafeeds">Manage Datafeeds</a>
				<?php 
    if (isset($errors) && is_array($errors) && count($errors)) {