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


PHP Email::__construct方法代码示例

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


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

示例1: __construct

 public function __construct(array $options = null)
 {
     if (!is_array($options)) {
         $options = [];
     }
     if (empty($options["smtpServer"])) {
         $hostname = "localhost";
     } else {
         $hostname = $options["smtpServer"];
     }
     if ($hostname === "localhost") {
         $port = isset($options["local-port"]) ? $options["local-port"] : 25;
     } else {
         $port = isset($options["port"]) ? $options["port"] : 465;
     }
     $server = new Server($hostname, $port);
     if (!empty($options["username"]) || !empty($options["password"])) {
         $server->setCredentials($options["username"], $options["password"]);
     }
     if (!empty($options["encryption"])) {
         $server->setEncryptionMethod($options["encryption"]);
     }
     if (!empty($options["returnPath"])) {
         $server->setReturnPath($options["returnPath"]);
     }
     parent::__construct($server);
     if (!empty($options["fromAddress"])) {
         $this->setFromAddress($options["fromAddress"], $options["fromName"]);
     }
 }
开发者ID:duncan3dc,项目名称:swiftmailer,代码行数:30,代码来源:Mailer.php

示例2: __construct

 public function __construct($fromEmail, $message, $name = null, array $headers = [])
 {
     // If there's a name, add it to the subject
     if ($name) {
         $subject = $this->subject . ' from ' . $name;
     }
     parent::__construct($this->to, $fromEmail, $message, $subject);
 }
开发者ID:adamtomat,项目名称:contact_form_template,代码行数:8,代码来源:ContactEmail.php

示例3: __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);
 }
开发者ID:adrexia,项目名称:nzlarps,代码行数:12,代码来源:MemberApprovalEmail.php

示例4: __construct

 public function __construct($page, $member, $offers)
 {
     $from = $page->EmailFrom;
     $to = $member->Email;
     $subject = $page->NewOffersNewsletterSubject;
     parent::__construct($from, $to, $subject);
     $this->populateTemplate(new ArrayData(array('Member' => $member, 'TaskPage' => $page, 'Offers' => $offers, '$SiteName' => SiteConfig::current_site_config()->Title, '$LoginLink' => Director::absoluteURL(singleton('Security')->Link('login')))));
 }
开发者ID:seraphia,项目名称:donationcollector,代码行数:8,代码来源:NewOffersNewsletterEmail.php

示例5: ArrayData

 /**
  * @param Newsletter $newsletter
  * @param NewsletterType $type
  */
 function __construct($newsletter, $type = null)
 {
     $this->newsletter = $newsletter;
     $this->nlType = $type ? $type : $newsletter->getNewsletterType();
     parent::__construct();
     $this->body = $newsletter->getContentBody();
     $this->populateTemplate(new ArrayData(array('Newsletter' => $this->Newsletter, 'UnsubscribeLink' => $this->UnsubscribeLink())));
     $this->extend('updateNewsletterEmail', $this);
 }
开发者ID:roed,项目名称:silverstripe-newsletter,代码行数:13,代码来源:NewsletterEmail.php

示例6: ArrayData

 /**
  * @param Newsletter $newsletter
  * @param Mailinglists $recipient
  * @param Boolean $fakeRecipient
  */
 function __construct($newsletter, $recipient, $fakeRecipient = false)
 {
     $this->newsletter = $newsletter;
     $this->mailinglists = $newsletter->MailingLists();
     $this->recipient = $recipient;
     $this->fakeRecipient = $fakeRecipient;
     parent::__construct($this->newsletter->SendFrom, $this->recipient->Email);
     $this->populateTemplate(new ArrayData(array('UnsubscribeLink' => $this->UnsubscribeLink(), 'SiteConfig' => DataObject::get_one('SiteConfig'), 'AbsoluteBaseURL' => Director::absoluteBaseURLWithAuth())));
     $this->body = $newsletter->getContentBody();
     $this->subject = $newsletter->Subject;
     $this->ss_template = $newsletter->RenderTemplate;
     if ($this->body && $this->newsletter) {
         $text = $this->body->forTemplate();
         //Recipient Fields ShortCode parsing
         $bodyViewer = new SSViewer_FromString($text);
         $text = $bodyViewer->process($this->templateData());
         // Install link tracking by replacing existing links with "newsletterlink" and hash-based reference.
         if ($this->config()->link_tracking_enabled && !$this->fakeRecipient && preg_match_all("/<a\\s[^>]*href=\"([^\"]*)\"[^>]*>(.*)<\\/a>/siU", $text, $matches)) {
             if (isset($matches[1]) && ($links = $matches[1])) {
                 $titles = isset($matches[2]) ? $matches[2] : array();
                 $id = (int) $this->newsletter->ID;
                 $replacements = array();
                 $current = array();
                 // workaround as we want to match the longest urls (/foo/bar/baz) before /foo/
                 array_unique($links);
                 $sorted = array_combine($links, array_map('strlen', $links));
                 arsort($sorted);
                 foreach ($sorted as $link => $length) {
                     $SQL_link = Convert::raw2sql($link);
                     $tracked = DataObject::get_one('Newsletter_TrackedLink', "\"NewsletterID\" = '" . $id . "' AND \"Original\" = '" . $SQL_link . "'");
                     if (!$tracked) {
                         // make one.
                         $tracked = new Newsletter_TrackedLink();
                         $tracked->Original = $link;
                         $tracked->NewsletterID = $id;
                         $tracked->write();
                     }
                     // replace the link
                     $replacements[$link] = $tracked->Link();
                     // track that this link is still active
                     $current[] = $tracked->ID;
                 }
                 // replace the strings
                 $text = str_ireplace(array_keys($replacements), array_values($replacements), $text);
             }
         }
         // replace the body
         $output = new HTMLText();
         $output->setValue($text);
         $this->body = $output;
     }
 }
开发者ID:tractorcow,项目名称:silverstripe-newsletter,代码行数:57,代码来源:NewsletterEmail.php

示例7: __construct

 public function __construct($member = null)
 {
     $member = $member ? $member : Member::currentUser();
     $link = Director::absoluteBaseUrl();
     $host = parse_url($link, PHP_URL_HOST);
     $this->subject = _t('WelcomeEmail.SUBJECT', "Welcome to {Website}", 'Email subject', ['Website' => SiteConfig::current_site_config()->Title]);
     if ($member) {
         $this->to = $member->Email;
         if ($member->FirstName) {
             $name = trim($member->FirstName . ' ' . $member->Surname);
             $this->to = $name . ' <' . $member->Email . '>';
         }
     }
     parent::__construct();
     $this->populateTemplate(new ArrayData(['Member' => $member, 'AbsoluteWebsiteLink' => $link, 'WebsiteLink' => $host]));
 }
开发者ID:lekoala,项目名称:silverstripe-foundation-emails,代码行数:16,代码来源:WelcomeEmail.php

示例8: __construct

 public function __construct($content)
 {
     //Email is not set as on - none shall pass...
     if (!$this->config()->enable_email) {
         return;
     }
     //Check for a to and throw error if none set.
     if (!$this->config()->email_to) {
         user_error("You have not set an 'email_to' in the config", E_USER_ERROR);
         return;
     }
     $from = Config::inst()->get('Email', 'admin_email');
     $to = $this->config()->email_to;
     $subject = "Suspected spammer: Please review";
     parent::__construct($from, $to, $subject);
     $this->populateTemplate(new ArrayData(array('Content' => $content)));
 }
开发者ID:helpfulrobot,项目名称:camfindlay-silverstripe-suspendspammer,代码行数:17,代码来源:SuspendSpammerEmail.php

示例9: __construct

 public function __construct($from = null, $to = null, $subject = null, $body = null, $bounceHandlerURL = null, $cc = null, $bcc = null)
 {
     parent::__construct($from, $to, $subject, $body, $bounceHandlerURL, $cc, $bcc);
     // Use config template
     if ($defaultTemplate = self::config()->default_template) {
         $this->setTemplate($defaultTemplate);
     }
     // Allow subclass template
     $class = get_called_class();
     if ($class != 'MandrillEmail') {
         $this->ss_template = array('email/' . $class, $this->ss_template);
     }
     // Allow user configurable theming
     $config = SiteConfig::current_site_config();
     if ($config->EmailTheme) {
         $this->setTheme($config->EmailTheme);
     } elseif ($theme = self::config()->default_theme) {
         $this->setTheme($theme);
     }
 }
开发者ID:zarocknz,项目名称:silverstripe-mandrill,代码行数:20,代码来源:MandrillEmail.php

示例10:

 function __construct()
 {
     parent::__construct();
     $this->subject = _t('Member.SUBJECTPASSWORDRESET', "Your password reset link", PR_MEDIUM, 'Email subject');
 }
开发者ID:nicmart,项目名称:comperio-site,代码行数:5,代码来源:Member.php

示例11: __construct

 /**
  * __construct
  *
  * @param \Never5\LicenseWP\License\License $license
  * @param string $first_name
  */
 public function __construct($license, $first_name)
 {
     $subject = sprintf('Your %s license keys', get_bloginfo('name'));
     parent::__construct($subject, 'new-license-email.php', array('license' => $license, 'user_first_name' => $first_name, 'email_heading' => $subject));
 }
开发者ID:ChromeOrange,项目名称:license-wp,代码行数:11,代码来源:NewLicense.php

示例12:

	function __construct() {
		parent::__construct();
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:3,代码来源:UserDefinedForm.php

示例13: __construct

 public function __construct($submittedFields = null)
 {
     parent::__construct($submittedFields = null);
 }
开发者ID:sekjal,项目名称:silverstripe-userforms,代码行数:4,代码来源:UserDefinedForm.php

示例14: __construct

 /**
  * Constructor
  * @param object $db
  */
 public function __construct(&$db)
 {
     $this->db =& $db;
     $this->smTextObject = new TableText($this->db);
     parent::__construct();
 }
开发者ID:bash-t,项目名称:admidio,代码行数:10,代码来源:systemmail.php

示例15: __construct

 public function __construct($from = null, $to = null, $subject = null, $body = null, $bounceHandlerURL = null, $cc = null, $bcc = null)
 {
     parent::__construct($from, $to, $subject, $body, $bounceHandlerURL, $cc, $bcc);
     user_error('Email_Template is deprecated. Please use Email instead.', E_USER_NOTICE);
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:5,代码来源:Email.php


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