當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Gdn_Email::From方法代碼示例

本文整理匯總了PHP中Gdn_Email::From方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gdn_Email::From方法的具體用法?PHP Gdn_Email::From怎麽用?PHP Gdn_Email::From使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gdn_Email的用法示例。


在下文中一共展示了Gdn_Email::From方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: SendEmailMessage

 /** 
  * Send email message.
  */
 function SendEmailMessage($Recipient, $Subject, $Message, $Options = False)
 {
     $MimeType = ArrayValue('MimeType', $Options, 'text/plain');
     $SenderEmail = ArrayValue('SenderEmail', $Options, '');
     $SenderName = ArrayValue('SenderName', $Options, '');
     $Email = new Gdn_Email();
     $Result = $Email->From($SenderEmail, $SenderName)->MimeType($MimeType)->Subject($Subject)->To($Recipient)->Message($Message)->Send();
     return $Result;
 }
開發者ID:ru4,項目名稱:arabbnota,代碼行數:12,代碼來源:functions.misc.php

示例2: PasswordRequest

 public function PasswordRequest($Email)
 {
     $User = $this->GetWhere(array('Email' => $Email))->FirstRow();
     if (!is_object($User) || $Email == '') {
         return FALSE;
     }
     $PasswordResetKey = RandomString(6);
     $this->SaveAttribute($User->UserID, 'PasswordResetKey', $PasswordResetKey);
     $AppTitle = Gdn::Config('Garden.Title');
     $Email = new Gdn_Email();
     $Email->Subject(sprintf(Gdn::Translate('[%s] Password Reset Request'), $AppTitle));
     $Email->To($User->Email);
     $Email->From(Gdn::Config('Garden.Support.Email'), Gdn::Config('Garden.Support.Name'));
     $Email->Message(sprintf(Gdn::Translate('PasswordRequest'), $User->Name, $AppTitle, Url('/entry/passwordreset/' . $User->UserID . '/' . $PasswordResetKey, TRUE)));
     $Email->Send();
     return TRUE;
 }
開發者ID:robi-bobi,項目名稱:Garden,代碼行數:17,代碼來源:class.usermodel.php

示例3: Send

 public function Send($InvitationID)
 {
     $Invitation = $this->GetByInvitationID($InvitationID);
     $Session = Gdn::Session();
     if ($Invitation === FALSE) {
         throw new Exception(T('ErrorRecordNotFound'));
     } else {
         if ($Session->UserID != $Invitation->SenderUserID) {
             throw new Exception(T('ErrorPermission'));
         } else {
             // Some information for the email
             $RegistrationUrl = CombinePaths(array(Gdn::Request()->WebPath(TRUE, FALSE), 'entry', 'register', $Invitation->Code), '/');
             $AppTitle = Gdn::Config('Garden.Title');
             $Email = new Gdn_Email();
             $Email->Subject(sprintf(T('[%s] Invitation'), $AppTitle));
             $Email->To($Invitation->Email);
             $Email->From($Invitation->SenderEmail, $Invitation->SenderName);
             $Email->Message(sprintf(T('EmailInvitation'), $Invitation->SenderName, $AppTitle, $RegistrationUrl));
             $Email->Send();
         }
     }
 }
開發者ID:sheldon,項目名稱:Garden,代碼行數:22,代碼來源:class.invitationmodel.php

示例4: SendNotification

 public function SendNotification($ActivityID, $Story = '')
 {
     $Activity = $this->GetID($ActivityID);
     if (!is_object($Activity)) {
         return;
     }
     $Story = Format::Text($Story == '' ? $Activity->Story : $Story);
     // If this is a comment on another activity, fudge the activity a bit so that everything appears properly.
     if (is_null($Activity->RegardingUserID) && $Activity->CommentActivityID > 0) {
         $CommentActivity = $this->GetID($Activity->CommentActivityID);
         $Activity->RegardingUserID = $CommentActivity->RegardingUserID;
         $Activity->Route = '/profile/' . $CommentActivity->RegardingUserID . '/' . Format::Url($CommentActivity->RegardingName) . '/#Activity_' . $Activity->CommentActivityID;
     }
     $User = $this->SQL->Select('Name, Email, Preferences')->From('User')->Where('UserID', $Activity->RegardingUserID)->Get()->FirstRow();
     if ($User) {
         $Preferences = Format::Unserialize($User->Preferences);
         $Preference = ArrayValue('Email.' . $Activity->ActivityType, $Preferences, Gdn::Config('Preferences.Email.' . $Activity->ActivityType));
         if ($Preference) {
             $ActivityHeadline = Format::Text(Format::ActivityHeadline($Activity, $Activity->ActivityUserID, $Activity->RegardingUserID));
             $Email = new Gdn_Email();
             $Email->Subject(sprintf(T('[%1$s] %2$s'), Gdn::Config('Garden.Title'), $ActivityHeadline));
             $Email->To($User->Email, $User->Name);
             $Email->From(Gdn::Config('Garden.SupportEmail'), Gdn::Config('Garden.SupportName'));
             $Email->Message(sprintf(T($Story == '' ? 'EmailNotification' : 'EmailStoryNotification'), $ActivityHeadline, Url($Activity->Route == '' ? '/' : $Activity->Route, TRUE), $Story));
             try {
                 $Email->Send();
             } catch (Exception $ex) {
                 // Don't do anything with the exception.
             }
         }
     }
 }
開發者ID:nbudin,項目名稱:Garden,代碼行數:32,代碼來源:class.activitymodel.php


注:本文中的Gdn_Email::From方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。