コード例 #1
0
ファイル: moderationStep1.php プロジェクト: ctcit/mailchimp
            }
            $args = array("action" => "edit", "msgid" => $msgid, "ctcid" => $ctcid, "modid" => $modid);
            $title = "Click to edit before sending";
            $modbody .= "<a href='{$step2Url}?" . http_build_query($args) . "'>\n\t\t\t                  <img src='{$step2ImageUrl}?img=1&" . http_build_query($args) . "' {$props} title='" . htmlentities($title) . "'/></a><br/>";
            $args = array("action" => "discard", "msgid" => $msgid, "ctcid" => $ctcid, "modid" => $modid);
            $title = "Click to discard";
            $modbody .= "<a href='{$step2Url}?" . http_build_query($args) . "'>\n\t\t\t                  <img src='{$step2ImageUrl}?img=1&" . http_build_query($args) . "' {$props} title='" . htmlentities($title) . "'/></a><br/>";
            $modbody .= "\t\t</td></tr>\n\t\t\t\t\t</table>";
            if (ModerationConfig::Step1SendEnabled) {
                # Invoke JMail Class
                $mailer = JFactory::getMailer();
                # Set sender array so that my name will show up neatly in your inbox
                $mailer->setSender($sender);
                # Add a recipient -- this can be a single address (string) or an array of addresses
                $mailer->addRecipient($modemail);
                $mailer->isHtml(true);
                $mailer->setBody($modbody);
                $mailer->setSubject(ModerationConfig::Step1SubjectPrefix . $subject);
                # Send once you have set all of your options
                $result = $mailer->send();
                //$result = mail($modemail, ModerationConfig::Step1SubjectPrefix.$subject, $modbody, $headers);
            } else {
                $result = "Send Disabled";
            }
            echo "\t<tr><th>Moderator</th><td>{$modemail} {$modname}</td></tr>\n\t\t\t\t<tr><th>mail() result</th><td>{$result}</td></tr>\n\t\t\t\t<tr><th>Moderation message</th><td>{$modbody}</td></tr>";
        }
        echo "</table>";
        file_put_contents(ModerationConfig::GetUnmoderatedDir() . "/cur/{$msgid},S=" . strlen($raw), $raw);
        unlink("{$dir}/{$file}");
    }
}
コード例 #2
0
<?php

define('_VALID_MOS', 1);
require_once '/home1/ctcweb9/public_html/includes/alastair.php';
require_once '/home1/ctcweb9/public_html/mailchimp/moderation.config.php';
GetLogonDetails($con, $username);
$dirs = array(ModerationConfig::GetInboxDir() . "/cur", ModerationConfig::GetInboxDir() . "/new", ModerationConfig::GetUnmoderatedDir() . "/cur", ModerationConfig::GetUnmoderatedDir() . "/new", ModerationConfig::GetModeratedDir() . "/cur", ModerationConfig::GetModeratedDir() . "/new");
foreach ($dirs as $dir) {
    $files = scandir($dir);
    foreach ($files as $file) {
        if (is_dir("{$dir}/{$file}")) {
            continue;
        }
        echo "deleting {$dir}/{$file}</br>";
        unlink("{$dir}/{$file}");
    }
}
$dir = "/home1/ctcweb9/public_html/mailchimp/TestEmails";
$files = scandir($dir);
foreach ($files as $file) {
    if (is_dir("{$dir}/{$file}")) {
        continue;
    }
    echo "copying {$dir}/{$file} to " . ModerationConfig::GetInboxDir() . "/cur/{$file}</br>";
    file_put_contents(ModerationConfig::GetInboxDir() . "/cur/{$file}", file_get_contents("{$dir}/{$file}"));
}