本文整理汇总了PHP中Email::getAdminEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::getAdminEmail方法的具体用法?PHP Email::getAdminEmail怎么用?PHP Email::getAdminEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Email
的用法示例。
在下文中一共展示了Email::getAdminEmail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register
/**
* Save the member and redirect
*/
function register($data, $form, $request)
{
//Check if this member already exists
// Create new OR update logged in {@link Member} record
$member = CleanUpRole::createOrMerge($data);
$tempMember = TempMember::Emailexists($data);
if (!$member || $tempMember) {
$form->sessionMessage(_t('RegisterForm.MEMBEREXISTS', 'Sorry, a member already exists with that email address.
If this is your email address, please <a href="my-events/">log in here</a>'), 'bad');
Director::redirectBack();
return false;
}
//CHANGE
//Create temp member
$tempMember = new TempMember();
$form->saveInto($tempMember);
if ($tempMember->write()) {
// Send a confirmation Email
$from = Email::getAdminEmail();
$to = $tempMember->Email;
$name = $tempMember->FirstName;
$subject = 'Thank you for joining Love Your Coast';
$email = new joinEmail_SignUpMessage();
$email->setFrom($from);
$email->setTo($to);
$email->setSubject($subject);
$email->populateTemplate(array('Contact' => $name, 'VerificationCode' => $tempMember->VerificationCode));
$email->send();
Director::redirect('success');
} else {
$form->sessionMessage(_t("Register.REGISTRATION ERROR", "Your registration wasn't successful please try again"), 'bad');
Director::redirectBack();
}
//END-OF-CHANGE
}
示例2: send_message
/**
* make sure to return TRUE as response if the message is sent
* successfully
* Sends a message from the current user to someone else in the networkd
* @param Int | String | Member $to -
* @param String $message - Message you are sending
* @param String $link - Link to send with message - NOT USED IN EMAIL
* @param Array - other variables that we include
* @return Boolean - return TRUE as success
*/
public static function send_message($to, $message, $link = "", $otherVariables = array())
{
//FROM
if (!empty($otherVariables["From"])) {
$from = $otherVariables["From"];
} else {
$from = Email::getAdminEmail();
}
//TO
if ($to instanceof Member) {
$to = $to->Email;
}
//SUBJECT
if (!empty($otherVariables["Subject"])) {
$subject = $otherVariables["Subject"];
} else {
$subject = substr($message, 0, 30);
}
//BODY
$body = $message;
//CC
if (!empty($otherVariables["CC"])) {
$cc = $otherVariables["CC"];
} else {
$cc = "";
}
//BCC
$bcc = Email::getAdminEmail();
//SEND EMAIL
$email = new Email($from, $to, $subject, $body, $bounceHandlerURL = null, $cc, $bcc);
return $email->send();
}
示例3: dosave
/**
* Form action handler for ContactInquiryForm.
*
* @param array $data The form request data submitted
* @param Form $form The {@link Form} this was submitted on
*/
function dosave(array $data, Form $form, SS_HTTPRequest $request)
{
$SQLData = Convert::raw2sql($data);
$attrs = $form->getAttributes();
if ($SQLData['Comment'] != '' || $SQLData['Url'] != '') {
// most probably spam - terminate silently
Director::redirect(Director::baseURL() . $this->URLSegment . "/success");
return;
}
$item = new ContactInquiry();
$form->saveInto($item);
// $form->sessionMessage(_t("ContactPage.FORMMESSAGEGOOD", "Your inquiry has been submitted. Thanks!"), 'good');
$item->write();
$mailFrom = $this->currController->MailFrom ? $this->currController->MailFrom : $SQLData['Email'];
$mailTo = $this->currController->MailTo ? $this->currController->MailTo : Email::getAdminEmail();
$mailSubject = $this->currController->MailSubject ? $this->currController->MailSubject . ' - ' . $SQLData['Ref'] : _t('ContactPage.SUBJECT', '[web] New contact inquiry - ') . ' ' . $data['Ref'];
$email = new Email($mailFrom, $mailTo, $mailSubject);
$email->replyTo($SQLData['Email']);
$email->setTemplate("ContactInquiry");
$email->populateTemplate($SQLData);
$email->send();
// $this->controller->redirectBack();
if ($email->send()) {
$this->controller->redirect($this->controller->Link() . "success");
} else {
$this->controller->redirect($this->controller->Link() . "error");
}
return false;
}
示例4: __construct
/**
* Create the new notification email.
*
* @param Member $customer
* @param Order $order
* @param String $from
* @param String $to
* @param String $subject
* @param String $body
* @param String $bounceHandlerURL
* @param String $cc
* @param String $bcc
*/
public function __construct(Member $customer, Order $order, $from = null, $to = null, $subject = null, $body = null, $bounceHandlerURL = null, $cc = null, $bcc = null)
{
$siteConfig = ShopConfig::get()->first();
if ($siteConfig->NotificationTo) {
$this->to = $siteConfig->NotificationTo;
}
if ($siteConfig->NotificationSubject) {
$this->subject = $siteConfig->NotificationSubject . ' - Order #' . $order->ID;
}
if ($siteConfig->NotificationBody) {
$this->body = $siteConfig->NotificationBody;
}
if ($customer->Email) {
$this->from = $customer->Email;
} elseif (Email::getAdminEmail()) {
$this->from = Email::getAdminEmail();
} else {
$this->from = 'no-reply@' . $_SERVER['HTTP_HOST'];
}
$this->signature = '';
$adminLink = Director::absoluteURL('/admin/shop/');
//Get css for Email by reading css file and put css inline for emogrification
$this->setTemplate('Order_NotificationEmail');
if (file_exists(Director::getAbsFile($this->ThemeDir() . '/css/ShopEmail.css'))) {
$css = file_get_contents(Director::getAbsFile($this->ThemeDir() . '/css/ShopEmail.css'));
} else {
$css = file_get_contents(Director::getAbsFile('swipestripe/css/ShopEmail.css'));
}
$this->populateTemplate(array('Message' => $this->Body(), 'Order' => $order, 'Customer' => $customer, 'InlineCSS' => "<style>{$css}</style>", 'Signature' => $this->signature, 'AdminLink' => $adminLink));
parent::__construct($from, null, $subject, $body, $bounceHandlerURL, $cc, $bcc);
}
示例5: __construct
/**
* @param MemberProfilePage $page
* @param Member $member
*/
public function __construct($page, $member)
{
$from = $page->EmailFrom ? $page->EmailFrom : Email::getAdminEmail();
$to = $member->Email;
$subject = self::get_parsed_string($page->ApprovalEmailSubject, $member, $page);
$body = self::get_parsed_string($page->ApprovalEmailTemplate, $member, $page);
parent::__construct($from, $to, $subject, $body);
}
示例6: updateCMSFields
/**
* Update the CMS fields on the extended object
*
* @param FieldList $fields
*/
public function updateCMSFields(FieldList $fields)
{
$member = Member::currentUser();
// lock down testing for the administrator only
if ($member->Email == Email::getAdminEmail()) {
$fields->addFieldToTab('Root.ABTesting', new CheckboxField('ABGlobalTest', 'This site currently undergoing AB testing.'));
$fields->addFieldToTab('Root.ABTesting', new TextareaField('ABTestGlobalScript', 'Inline Script for AB Testing (from Google content experiments)'));
}
}
示例7: onAfterWrite
function onAfterWrite()
{
parent::onAfterWrite();
if (!$this->Sent) {
$email = new Email($from = Email::getAdminEmail(), $to = $this->To, $subject = $this->Subject, $body = $this->Body, $bounceHandlerURL = null, $cc = null, $bcc = Email::getAdminEmail());
$email->send();
$this->Sent = 1;
$this->write();
}
}
示例8: createEmail
public function createEmail($subject = "Website Enquiry", $template = "GenericEmail")
{
$content = $this->renderWith("EnquiryEmail_content");
$to = Email::getAdminEmail();
$email = new Email($this->Email, $to, $subject);
$email->setTemplate($template);
$email->populateTemplate($this);
$email->populateTemplate(array('Body' => $content));
$this->extend('updateReceiptEmail', $email);
return $email;
}
示例9: doContact
public function doContact(array $data)
{
$email = new Email();
$email->setTo(Email::getAdminEmail());
$email->setFrom($data['Email']);
$email->setSubject(_t('ContactForm.SUBJECT', 'ContactForm.SUBJECT') . $data['Name']);
$email->setBody($data['Message']);
//$email->set
$email->send();
$this->sessionMessage(_t('ContactForm.SUCCESS', 'ContactForm.SUCCESS'), 'good');
$this->controller->redirectBack();
}
示例10: go
function go()
{
$from = Email::getAdminEmail();
$to = $this->Recipient;
$subject = 'Clean Up Week Reminder';
$memberid = $this->MemberID;
$member = DataObject::get_one('Member', "Member.ID = '{$memberid}'");
$cleanups = $member->myCleanUpGroups($memberid);
$email = new EventReminderEmail();
$email->setFrom($from);
$email->setTo($to);
$email->setSubject($subject);
$email->populateTemplate(array('Member' => $member, 'CleanUps' => $cleanups));
$email->send();
}
示例11: emailNotice
protected function emailNotice($emailClass)
{
$from = Email::getAdminEmail();
$to = $this->Recipient;
$subject = $this->Subject ? $this->Subject : "Thanks for joining in on a Love Your Coast Event";
$name = $this->FirstName;
$cleanupid = $this->CleanUpGroupID;
$cleanup = DataObject::get_one('CleanUpGroup', "CleanUpGroup.ID = '{$cleanupid}'");
$email = new $emailClass();
$email->setFrom($from);
$email->setTo($to);
$email->setSubject($subject);
$email->populateTemplate(array('Contact' => $name, 'CleanUp' => $cleanup));
$email->send();
}
示例12: get_recipient
/**
* Returns the email address that should be notified of comments to the given page
*
* @param DataObject $parent Parent object
* @return string Email address, if available
*/
public static function get_recipient($parent)
{
$recipient = Config::inst()->get('CommentsNotifications', 'recipient');
switch ($recipient) {
case 'Disabled':
return null;
case 'SiteConfig':
return SiteConfig::current_site_config()->CommentNotificationEmail;
case 'Page':
return $parent->CommentNotificationEmail;
case 'Admin':
return Email::getAdminEmail();
default:
return $recipient;
}
}
开发者ID:helpfulrobot,项目名称:tractorcow-silverstripe-comments-notifications,代码行数:22,代码来源:CommentsNotifications.php
示例13: doRegister
/**
* Register action
* @param type $data
* @param type $form
* @return \SS_HTTPResponse
*/
public function doRegister($data, $form)
{
$r = new EventRegistration();
$form->saveInto($r);
$EventDetails = Event::get()->byID($r->EventID);
if ($EventDetails->TicketsRequired) {
$r->AmountPaid = $r->AmountPaid / 100;
}
$r->write();
$from = Email::getAdminEmail();
$to = $r->Email;
$bcc = $EventDetails->RSVPEmail;
$subject = "Event Registration - " . $EventDetails->Title . " - " . date("d/m/Y H:ia");
$body = "";
$email = new Email($from, $to, $subject, $body, null, null, $bcc);
$email->setTemplate('EventRegistration');
$email->send();
exit;
}
示例14: send
/**
*
* @param Null|String $messageID - ID for the message, you can leave this blank
* @param Order $order - the order to which the email relates
* @param Boolean $resend - should the email be resent even if it has been sent already?
* @return Boolean - TRUE for success and FALSE for failure.
*/
public function send($messageID = null, $order, $resend = false)
{
if (!$this->subject) {
$this->subject = self::get_subject();
}
$this->subject = str_replace("[OrderNumber]", $order->ID, $this->subject);
if (!$this->hasBeenSent($order) || $resend) {
if (EcommerceConfig::get("Order_Email", "copy_to_admin_for_all_emails") && $this->to != Email::getAdminEmail()) {
$this->setBcc(Email::getAdminEmail());
}
if (EcommerceConfig::get("Order_Email", "send_all_emails_plain")) {
$result = parent::sendPlain($messageID);
} else {
$result = parent::send($messageID);
}
$this->createRecord($result, $order);
return $result;
}
}
示例15: sendTempPasswordEmail
/**
* Send temporary password to user via email.
*/
public function sendTempPasswordEmail($template = null, $subject = null, $extradata = null)
{
//set expiry
$template = $template ? $template : 'TempPasswordEmail';
$subject = $subject ? $subject : "Temporary Password";
$data = array('CleartextTempPassword' => $this->owner->setupTempPassword());
if ($extradata) {
$data = array_merge($data, $extradata);
}
$body = $this->owner->customise($data)->renderWith($template);
if (Email::validEmailAddress($this->owner->Email)) {
$email = new Email(Email::getAdminEmail(), $this->owner->Email, $subject, $body);
if ($email->send()) {
return true;
}
return false;
}
return false;
}