当前位置: 首页>>代码示例>>PHP>>正文


PHP Mailer::send_preparation方法代码示例

本文整理汇总了PHP中Mailer::send_preparation方法的典型用法代码示例。如果您正苦于以下问题:PHP Mailer::send_preparation方法的具体用法?PHP Mailer::send_preparation怎么用?PHP Mailer::send_preparation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mailer的用法示例。


在下文中一共展示了Mailer::send_preparation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendAccountInfo

 function sendAccountInfo($sendtype, $sensitive)
 {
     global $Conf, $Opt;
     assert(!$this->disabled);
     $rest = array();
     if ($sendtype == "create" && $this->prefer_contactdb_password()) {
         $template = "@activateaccount";
     } else {
         if ($sendtype == "create") {
             $template = "@createaccount";
         } else {
             if ($this->plaintext_password() && ($Opt["safePasswords"] <= 1 || $sendtype != "forgot")) {
                 $template = "@accountinfo";
             } else {
                 if ($this->contactDbId && $this->prefer_contactdb_password()) {
                     $capmgr = $Conf->capability_manager("U");
                 } else {
                     $capmgr = $Conf->capability_manager();
                 }
                 $rest["capability"] = $capmgr->create(CAPTYPE_RESETPASSWORD, array("user" => $this, "timeExpires" => time() + 259200));
                 $Conf->log("Created password reset " . substr($rest["capability"], 0, 8) . "...", $this);
                 $template = "@resetpassword";
             }
         }
     }
     $mailer = new HotCRPMailer($this, null, $rest);
     $prep = $mailer->make_preparation($template, $rest);
     if ($prep->sendable || !$sensitive || get($Opt, "debugShowSensitiveEmail")) {
         Mailer::send_preparation($prep);
         return $template;
     } else {
         Conf::msg_error("Mail cannot be sent to " . htmlspecialchars($this->email) . " at this time.");
         return false;
     }
 }
开发者ID:vaskevich,项目名称:nu-admissions-review,代码行数:35,代码来源:contact.php

示例2: send_prep

 private function send_prep($prep)
 {
     global $Conf;
     $cbkey = "c" . join("_", $prep->contacts) . "p" . $prep->paperId;
     if ($this->sending && !defval($_REQUEST, $cbkey)) {
         return;
     }
     set_time_limit(30);
     $this->echo_prologue();
     self::fix_body($prep);
     ++$this->mcount;
     if ($this->sending) {
         Mailer::send_preparation($prep);
         foreach ($prep->contacts as $cid) {
             $Conf->log("Account was sent mail" . $this->mailid_text, $cid, $prep->paperId);
         }
     }
     // hide passwords from non-chair users
     $show_prep = $prep;
     if (get($prep, "sensitive")) {
         $show_prep = $prep->sensitive;
         $show_prep->to = $prep->to;
         self::fix_body($show_prep);
     }
     echo '<div class="mail"><table>';
     $nprintrows = 0;
     foreach (array("To", "cc", "bcc", "reply-to", "Subject") as $k) {
         if ($k == "To") {
             $vh = array();
             foreach ($show_prep->to as $to) {
                 $vh[] = htmlspecialchars(MimeText::decode_header($to));
             }
             $vh = '<div style="max-width:60em"><span class="nw">' . join(',</span> <span class="nw">', $vh) . '</span></div>';
         } else {
             if ($k == "Subject") {
                 $vh = htmlspecialchars(MimeText::decode_header($show_prep->subject));
             } else {
                 if ($line = get($show_prep->headers, $k)) {
                     $k = substr($line, 0, strlen($k));
                     $vh = htmlspecialchars(MimeText::decode_header(substr($line, strlen($k) + 2)));
                 } else {
                     continue;
                 }
             }
         }
         echo " <tr>";
         if (++$nprintrows > 1) {
             echo "<td class='mhpad'></td>";
         } else {
             if ($this->sending) {
                 echo "<td class='mhx'></td>";
             } else {
                 ++$this->cbcount;
                 echo '<td class="mhcb"><input type="checkbox" class="cb" name="', $cbkey, '" value="1" checked="checked" data-range-type="mhcb" id="psel', $this->cbcount, '" onclick="rangeclick(event,this)" /></td>';
             }
         }
         echo '<td class="mhnp nw">', $k, ":</td>", '<td class="mhdp">', $vh, "</td></tr>\n";
     }
     echo " <tr><td></td><td></td><td class='mhb'><pre class='email'>", Ht::link_urls(htmlspecialchars($show_prep->body)), "</pre></td></tr>\n", "<tr><td class='mhpad'></td><td></td><td class='mhpad'></td></tr>", "</table></div>\n";
 }
开发者ID:vaskevich,项目名称:nu-admissions-review,代码行数:60,代码来源:mail.php

示例3: save_user

function save_user($cj, $user_status, $Acct, $allow_modification)
{
    global $Conf, $Me, $Opt, $OK, $newProfile;
    if ($newProfile) {
        $Acct = null;
    }
    // check for missing fields
    UserStatus::normalize_name($cj);
    if ($newProfile && !isset($cj->email)) {
        $user_status->set_error("email", "Email address required.");
        return false;
    }
    // check email
    if ($newProfile || $cj->email != $Acct->email) {
        if ($new_acct = Contact::find_by_email($cj->email)) {
            if ($allow_modification) {
                $cj->id = $new_acct->contactId;
            } else {
                $msg = "Email address “" . htmlspecialchars($cj->email) . "” is already in use.";
                if ($Me->privChair) {
                    $msg = str_replace("an account", "<a href=\"" . hoturl("profile", "u=" . urlencode($cj->email)) . "\">an account</a>", $msg);
                }
                if (!$newProfile) {
                    $msg .= " You may want to <a href=\"" . hoturl("mergeaccounts") . "\">merge these accounts</a>.";
                }
                return $user_status->set_error("email", $msg);
            }
        } else {
            if (Contact::external_login()) {
                if ($cj->email === "") {
                    return $user_status->set_error("email", "Not a valid username.");
                }
            } else {
                if ($cj->email === "") {
                    return $user_status->set_error("email", "You must supply an email address.");
                } else {
                    if (!validate_email($cj->email)) {
                        return $user_status->set_error("email", "“" . htmlspecialchars($cj->email) . "” is not a valid email address.");
                    }
                }
            }
        }
        if (!$newProfile && !$Me->privChair) {
            $old_preferredEmail = $Acct->preferredEmail;
            $Acct->preferredEmail = $cj->email;
            $capmgr = $Conf->capability_manager();
            $rest = array("capability" => $capmgr->create(CAPTYPE_CHANGEEMAIL, array("user" => $Acct, "timeExpires" => time() + 259200, "data" => json_encode(array("uemail" => $cj->email)))));
            $mailer = new HotCRPMailer($Acct, null, $rest);
            $prep = $mailer->make_preparation("@changeemail", $rest);
            if ($prep->sendable) {
                Mailer::send_preparation($prep);
                $Conf->warnMsg("Mail has been sent to " . htmlspecialchars($cj->email) . ". Use the link it contains to confirm your email change request.");
            } else {
                Conf::msg_error("Mail cannot be sent to " . htmlspecialchars($cj->email) . " at this time. Your email address was unchanged.");
            }
            // Save changes *except* for new email, by restoring old email.
            $cj->email = $Acct->email;
            $Acct->preferredEmail = $old_preferredEmail;
        }
    }
    // save account
    return $user_status->save($cj, $Acct, $Me);
}
开发者ID:vaskevich,项目名称:nu-admissions-review,代码行数:63,代码来源:profile.php


注:本文中的Mailer::send_preparation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。