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


PHP UserMailer::send方法代码示例

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


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

示例1: contact

 private function contact()
 {
     global $wgEmergencyContact;
     $this->getOutput()->addModules('skins.settlein.special.contact');
     $this->getOutput()->setPageTitle('Contact Us | SettleIn');
     $data = array();
     if ($this->getRequest()->wasPosted()) {
         $name = $this->getRequest()->getVal('name');
         $email = $this->getRequest()->getVal('email');
         $message = $this->getRequest()->getVal('message');
         $reason = $this->getRequest()->getVal('reason');
         $reason = wfMessage('settlein-skin-project-page-contact-field-reason-value-' . ((int) $reason + 1))->plain();
         $to = new MailAddress($wgEmergencyContact);
         $from = new MailAddress($email, $name);
         $subject = "New request from SettleIn website";
         $body = "Reason: " . $reason . "\n\n" . $message;
         UserMailer::send($to, $from, $subject, $body);
         $this->getOutput()->redirect($this->getFullTitle()->getFullURL('success=yes'));
         return false;
     } else {
         if ($this->getRequest()->getVal('success')) {
             $html = Views::forge('contactpost_new', $data);
         } else {
             $html = Views::forge('contact_new', $data);
         }
     }
     $this->getOutput()->addHTML($html);
 }
开发者ID:vedmaka,项目名称:SettleInSkin,代码行数:28,代码来源:SettleInSpecial.php

示例2: execute

 public function execute($subpage)
 {
     global $wgRequest, $wgForceSendgridEmail, $wgForceSchwartzEmail;
     wfProfileIn(__METHOD__);
     // Don't allow just anybody to use this
     if ($this->mChallengeToken != $wgRequest->getVal('challenge')) {
         header("Status: 400");
         header("Content-type: text/plain");
         print "Challenge incorrect";
         wfProfileOut(__METHOD__);
         exit;
     }
     // Make sure we get an email address
     $this->mAccount = $wgRequest->getVal('account');
     if (!$this->mAccount) {
         header("Status: 400");
         header("Content-type: text/plain");
         print "Parameter 'account' required";
         wfProfileOut(__METHOD__);
         exit;
     }
     # These two both have defaults
     $this->mText = $wgRequest->getVal('text', $this->mText);
     $this->mConfirmToken = $wgRequest->getVal('token', $this->mConfirmToken);
     $wgForceSendgridEmail = $wgRequest->getVal('force') == 'sendgrid';
     $wgForceSchwartzEmail = $wgRequest->getVal('force') == 'schwartz';
     UserMailer::send(new MailAddress($this->mAccount), new MailAddress('test@wikia-inc.com'), "EmailTest - End to end test", $this->mConfirmToken . "\n" . $this->mText, null, null, "emailtest");
     header("Status: 200");
     header("Content-type: text/plain");
     print $this->mConfirmToken;
     wfProfileOut(__METHOD__);
     exit;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:33,代码来源:SpecialEmailTest.php

示例3: notifyWithEmail

 /**
  * Send a Notification to a user by email
  *
  * @param $user User to notify.
  * @param $event EchoEvent to notify about.
  * @return bool
  */
 public static function notifyWithEmail($user, $event)
 {
     // No valid email address or email notification
     if (!$user->isEmailConfirmed() || $user->getOption('echo-email-frequency') < 0) {
         return false;
     }
     // Final check on whether to send email for this user & event
     if (!wfRunHooks('EchoAbortEmailNotification', array($user, $event))) {
         return false;
     }
     // See if the user wants to receive emails for this category or the user is eligible to receive this email
     if (in_array($event->getType(), EchoNotificationController::getUserEnabledEvents($user, 'email'))) {
         global $wgEchoEnableEmailBatch, $wgEchoNotifications, $wgNotificationSender, $wgNotificationSenderName, $wgNotificationReplyName, $wgEchoBundleEmailInterval;
         $priority = EchoNotificationController::getNotificationPriority($event->getType());
         $bundleString = $bundleHash = '';
         // We should have bundling for email digest as long as either web or email bundling is on, for example, talk page
         // email bundling is off, but if a user decides to receive email digest, we should bundle those messages
         if (!empty($wgEchoNotifications[$event->getType()]['bundle']['web']) || !empty($wgEchoNotifications[$event->getType()]['bundle']['email'])) {
             wfRunHooks('EchoGetBundleRules', array($event, &$bundleString));
         }
         if ($bundleString) {
             $bundleHash = md5($bundleString);
         }
         MWEchoEventLogging::logSchemaEcho($user, $event, 'email');
         // email digest notification ( weekly or daily )
         if ($wgEchoEnableEmailBatch && $user->getOption('echo-email-frequency') > 0) {
             // always create a unique event hash for those events don't support bundling
             // this is mainly for group by
             if (!$bundleHash) {
                 $bundleHash = md5($event->getType() . '-' . $event->getId());
             }
             MWEchoEmailBatch::addToQueue($user->getId(), $event->getId(), $priority, $bundleHash);
             return true;
         }
         $addedToQueue = false;
         // only send bundle email if email bundling is on
         if ($wgEchoBundleEmailInterval && $bundleHash && !empty($wgEchoNotifications[$event->getType()]['bundle']['email'])) {
             $bundler = MWEchoEmailBundler::newFromUserHash($user, $bundleHash);
             if ($bundler) {
                 $addedToQueue = $bundler->addToEmailBatch($event->getId(), $priority);
             }
         }
         // send single notification if the email wasn't added to queue for bundling
         if (!$addedToQueue) {
             // instant email notification
             $toAddress = new MailAddress($user);
             $fromAddress = new MailAddress($wgNotificationSender, $wgNotificationSenderName);
             $replyAddress = new MailAddress($wgNotificationSender, $wgNotificationReplyName);
             // Since we are sending a single email, should set the bundle hash to null
             // if it is set with a value from somewhere else
             $event->setBundleHash(null);
             $email = EchoNotificationController::formatNotification($event, $user, 'email', 'email');
             $subject = $email['subject'];
             $body = $email['body'];
             UserMailer::send($toAddress, $fromAddress, $subject, $body, $replyAddress);
             MWEchoEventLogging::logSchemaEchoMail($user, 'single');
         }
     }
     return true;
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:67,代码来源:Notifier.php

示例4: sendMail

 /**
  * Quickie wrapper function for sending out an email as properly rendered
  * HTML instead of plaintext.
  *
  * The functions in this class that call this function used to use
  * User::sendMail(), but it was causing the mentioned bug, hence why this
  * function had to be introduced.
  *
  * @see https://bugzilla.wikimedia.org/show_bug.cgi?id=68045
  *
  * @param User $string User (object) whom to send an email
  * @param string $subject Email subject
  * @param $string $body Email contents (HTML)
  * @return Status object
  */
 public function sendMail($user, $subject, $body)
 {
     global $wgPasswordSender;
     $sender = new MailAddress($wgPasswordSender, wfMessage('emailsender')->inContentLanguage()->text());
     $to = new MailAddress($user);
     return UserMailer::send($to, $sender, $subject, $body, null, 'text/html; charset=UTF-8');
 }
开发者ID:Reasno,项目名称:SocialProfile,代码行数:22,代码来源:UserRelationshipClass.php

示例5: execute

 public function execute()
 {
     $params = $this->extractRequestParams();
     // Validation
     if (!User::isValidEmailAddr($params['email'])) {
         $this->dieUsage('The email address does not appear to be valid', 'invalidemail');
     }
     // Verification code
     $code = md5('EmailCapture' . time() . $params['email'] . $params['info']);
     // Insert
     $dbw = wfGetDB(DB_MASTER);
     $dbw->insert('email_capture', array('ec_email' => $params['email'], 'ec_info' => isset($params['info']) ? $params['info'] : null, 'ec_code' => $code), __METHOD__, array('IGNORE'));
     if ($dbw->affectedRows()) {
         // Send auto-response
         global $wgEmailCaptureSendAutoResponse, $wgEmailCaptureAutoResponse;
         $title = SpecialPage::getTitleFor('EmailCapture');
         $link = $title->getCanonicalURL();
         $fullLink = $title->getCanonicalURL(array('verify' => $code));
         if ($wgEmailCaptureSendAutoResponse) {
             UserMailer::send(new MailAddress($params['email']), new MailAddress($wgEmailCaptureAutoResponse['from'], $wgEmailCaptureAutoResponse['from-name']), wfMsg($wgEmailCaptureAutoResponse['subject-msg']), wfMsg($wgEmailCaptureAutoResponse['body-msg'], $fullLink, $link, $code), $wgEmailCaptureAutoResponse['reply-to'], $wgEmailCaptureAutoResponse['content-type']);
         }
         $r = array('result' => 'Success');
     } else {
         $r = array('result' => 'Failure', 'message' => 'Duplicate email address');
     }
     $this->getResult()->addValue(null, $this->getModuleName(), $r);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:27,代码来源:ApiEmailCapture.php

示例6: sendExternalMails

 /**
  * Send email to external addresses
  */
 private function sendExternalMails()
 {
     global $wgNewUserNotifEmailTargets, $wgSitename;
     foreach ($wgNewUserNotifEmailTargets as $target) {
         UserMailer::send(new MailAddress($target), new MailAddress($this->sender), $this->makeSubject($target, $this->user), $this->makeMessage($target, $this->user));
     }
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:10,代码来源:NewUserNotif.class.php

示例7: sendEmail

 function sendEmail(&$u, &$content)
 {
     global $wgServer;
     wfLoadExtensionMessages('ThumbsEmailNotifications');
     $email = $u->getEmail();
     $userText = $u->getName();
     $semi_rand = md5(time());
     $mime_boundary = "==MULTIPART_BOUNDARY_{$semi_rand}";
     $mime_boundary_header = chr(34) . $mime_boundary . chr(34);
     $userPageLink = self::getUserPageLink($userText);
     $html_text = wfMsg('tn_email_html', wfGetPad(''), $userPageLink, $content);
     $plain_text = wfMsg('tn_email_plain', $userText, $u->getTalkPage()->getFullURL());
     $body = "This is a multi-part message in MIME format.\n\n--{$mime_boundary}\nContent-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n{$plain_text}\n\n--{$mime_boundary}\nContent-Type: text/html; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n{$html_text}";
     $from = new MailAddress(wfMsg('aen_from'));
     $subject = "Congratulations! You just got a thumbs up";
     $isDev = false;
     if (strpos($_SERVER['HOSTNAME'], "wikidiy.com") !== false || strpos($wgServer, "wikidiy.com") !== false) {
         wfDebug("AuthorEmailNotification in dev not notifying: TO: " . $userText . ",FROM: {$from_name}\n");
         $isDev = true;
         $subject = "[FROM DEV] {$subject}";
     }
     if (!$isDev) {
         $to = new MailAddress($email);
         UserMailer::send($to, $from, $subject, $body, null, "multipart/alternative;\n" . "     boundary=" . $mime_boundary_header);
     }
     // send one to our test email account for debugging
     /*
     $to = new MailAddress ('elizabethwikihowtest@gmail.com');
     UserMailer::send($to, $from, $subject, $body, null, "multipart/alternative;\n" .
     				"     boundary=" . $mime_boundary_header) ;
     */
     return true;
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:33,代码来源:ThumbsEmailNotifications.body.php

示例8: run

 /**
  * Run a SMW_NMSendMailJob job
  * @return boolean success
  */
 function run()
 {
     wfDebug(__METHOD__);
     wfProfileIn(__METHOD__);
     UserMailer::send($this->params['to'], $this->params['from'], $this->params['subj'], $this->params['body'], $this->params['replyto']);
     wfProfileOut(__METHOD__);
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:12,代码来源:SMW_NMSendMailJob.php

示例9: sendEmail

function sendEmail() {
	$from    = new MailAddress("community@wikia-inc.com");
	$to      = new MailAddress("garth@wikia-inc.com");
	$body    = "Test sendgrid email";
	$headers = array( "X-Msg-Category" => "Test" );
	$subject = "This is a sendgrid test";

	UserMailer::send($to, $from, $subject, $body);
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:9,代码来源:sendEmail.php

示例10: execute

 public function execute()
 {
     $fb = $this->getMain()->getVal('feedback');
     $user = $this->getUser();
     $subject = "用户bug反馈";
     $body = json_decode($fb);
     if ($user != '') {
         if ($body->note != '') {
             $trueSubject = $user->getName() . ":" . $body->note;
         } else {
             $trueSubject = $user->getName() . ":" . $body->note;
         }
     } else {
         if ($body->note != '') {
             $trueSubject = $body->note;
         } else {
             $trueSubject = $subject;
         }
     }
     $fs = wfGetFS(FS_OSS);
     $time = microtime();
     $id = HuijiFunctions::getTradeNo('FB');
     $fs->put("Feedback/{$id}.html", $body->html);
     $data = str_replace('data:image/png;base64,', '', $body->img);
     $data = str_replace(' ', '+', $data);
     $data = base64_decode($data);
     $source_img = imagecreatefromstring($data);
     imagepng($source_img, "/tmp/{$id}.png", 3);
     $fs->put("Feedback/{$id}.png", file_get_contents("/tmp/{$id}.png"));
     imagedestroy($source_img);
     $trueBody = $this->getSection('Issue');
     $trueBody .= $body->note;
     $trueBody .= $this->getSection('Cookie');
     foreach ($_COOKIE as $key => $value) {
         $trueBody .= $key . ":" . $value . ";" . PHP_EOL;
     }
     $trueBody .= $this->getSection('URL');
     $trueBody .= $body->url;
     $trueBody .= $this->getSection('源代码');
     $trueBody .= "http://fs.huijiwiki.com/Feedback/{$id}.html";
     $trueBody .= $this->getSection('Agent');
     foreach ($body->browser as $key => $value) {
         if (is_array($value)) {
             $trueBody .= $key . ":" . implode(", ", $value) . ";" . PHP_EOL;
         } else {
             $trueBody .= $key . ":" . $value . ";" . PHP_EOL;
         }
     }
     $trueBody .= $this->getSection('来源');
     $trueBody .= $body->referer;
     $trueBody .= $this->getSection('分辨率');
     $trueBody .= $body->w . "X" . $body->h;
     $trueBody .= $this->getSection('截图');
     $trueBody .= "http://fs.huijiwiki.com/Feedback/{$id}.png";
     $res = UserMailer::send(new MailAddress('xigu+4v9xc1lkbgfsjexbgigj@boards.trello.com', 'trello', 'trello'), new MailAddress("no-reply@huiji.wiki"), $trueSubject, $trueBody);
     $this->getResult()->addValue(null, $this->getModuleName(), $res);
 }
开发者ID:HuijiWiki,项目名称:HuijiMiddleware,代码行数:57,代码来源:FeedbackApi.php

示例11: sendMessage

 function sendMessage(\PageAttachment\User\User $user, $subject, $message)
 {
     global $wgNoReplyAddress;
     global $wgPasswordSender;
     $to = new \MailAddress($user->getEmailAddress());
     $from = new \MailAddress($wgPasswordSender);
     $replyTo = new \MailAddress($wgNoReplyAddress);
     \UserMailer::send($to, $from, $subject, $message, $replyTo);
 }
开发者ID:mediawiki-extensions,项目名称:mediawiki-page-attachment,代码行数:9,代码来源:EmailTransporter.php

示例12: sendWithPear

 /**
  * Send mail using a PEAR mailer
  *
  * @param UserMailer $mailer
  * @param string $dest
  * @param string $headers
  * @param string $body
  *
  * @return Status
  */
 protected static function sendWithPear($mailer, $dest, $headers, $body)
 {
     $mailResult = $mailer->send($dest, $headers, $body);
     # Based on the result return an error string,
     if (PEAR::isError($mailResult)) {
         wfDebug("PEAR::Mail failed: " . $mailResult->getMessage() . "\n");
         return Status::newFatal('pear-mail-error', $mailResult->getMessage());
     } else {
         return Status::newGood();
     }
 }
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:21,代码来源:UserMailer.php

示例13: check_existence_of_spamfile

function check_existence_of_spamfile($email)
{
    global $wgSitename, $wgCityId;
    $articles = getWikiArticles();
    if (!empty($articles)) {
        ob_start();
        echo $wgSitename, "\n";
        print_r($articles);
        $body = ob_get_clean();
        UserMailer::send(new MailAddress($email), new MailAddress($email), 'Spam list related pages in NS=8 on  ' . $wgSitename . ' - ' . $wgCityId, $body);
    }
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:12,代码来源:blackListMessageChecks.php

示例14: notifyUser

 /**
  * Notifies a single user of the changes made to properties in a single edit.
  *
  * @since 0.1
  *
  * @param SWLGroup $group
  * @param User $user
  * @param SWLChangeSet $changeSet
  * @param boolean $describeChanges
  *
  * @return Status
  */
 public static function notifyUser(SWLGroup $group, User $user, SWLChangeSet $changeSet, $describeChanges)
 {
     global $wgLang, $wgPasswordSender, $wgPasswordSenderName;
     $emailText = wfMsgExt('swl-email-propschanged-long', 'parse', $GLOBALS['wgSitename'], $changeSet->getEdit()->getUser()->getName(), SpecialPage::getTitleFor('SemanticWatchlist')->getFullURL(), $wgLang->time($changeSet->getEdit()->getTime()), $wgLang->date($changeSet->getEdit()->getTime()));
     if ($describeChanges) {
         $emailText .= '<h3> ' . wfMsgExt('swl-email-changes', 'parse', $changeSet->getEdit()->getTitle()->getFullText(), $changeSet->getEdit()->getTitle()->getFullURL()) . ' </h3>';
         $emailText .= self::getChangeListHTML($changeSet, $group);
     }
     $title = wfMsgReal('swl-email-propschanged', array($changeSet->getEdit()->getTitle()->getFullText()), true, $user->getOption('language'));
     wfRunHooks('SWLBeforeEmailNotify', array($group, $user, $changeSet, $describeChanges, &$title, &$emailText));
     return UserMailer::send(new MailAddress($user), new MailAddress($wgPasswordSender, $wgPasswordSenderName), $title, $emailText, null, 'text/html; charset=ISO-8859-1');
 }
开发者ID:nischayn22,项目名称:mediawiki-extensions-SemanticWatchlist,代码行数:24,代码来源:SWL_Emailer.php

示例15: sendNotification

 private function sendNotification()
 {
     global $wgFlowerUrl;
     $subject = "ImageReview deletion failed #{$this->taskId}";
     $body = "{$wgFlowerUrl}/task/{$this->taskId}";
     $recipients = [new \MailAddress('tor@wikia-inc.com'), new \MailAddress('adamk@wikia-inc.com'), new \MailAddress('sannse@wikia-inc.com')];
     $from = $recipients[0];
     foreach ($recipients as $recipient) {
         \UserMailer::send($recipient, $from, $subject, $body);
     }
     WikiaLogger::instance()->error("ImageReviewLog", ['method' => __METHOD__, 'message' => "Task #{$this->taskId} deleting images did not succeed. Please check.", 'taskId' => $this->taskId, 'taskUrl' => $body]);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:12,代码来源:ImageReviewTask.class.php


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