当前位置: 首页>>代码示例>>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;未经允许,请勿转载。