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


PHP Mage_Core_Model_Email_Template::sendTransactional方法代码示例

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


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

示例1: sendTransactional

 /**
  * Send transactional email to recipient
  *
  * @see Mage_Core_Model_Email_Template::sendTransactional()
  * @param   string $templateId
  * @param   string|array $sender sneder information, can be declared as part of config path
  * @param   string $email recipient email
  * @param   string $name recipient name
  * @param   array $vars varianles which can be used in template
  * @param   int|null $storeId
  * @return  Mage_Core_Model_Email_Template
  */
 public function sendTransactional($templateId, $sender, $email, $name, $vars = array(), $storeId = null)
 {
     $this->_templateId = $templateId;
     $sendType = Mage::helper('connector/transactional')->getMapping($templateId, Dotdigitalgroup_Email_Helper_Transactional::MAP_COLUMN_KEY_SENDTYPE, $storeId);
     $transEnabled = Mage::getStoreConfig(Dotdigitalgroup_Email_Helper_Transactional::XML_PATH_TRANSACTIONAL_API_ENABLED, $storeId);
     $campaignId = Mage::helper('connector/transactional')->getMapping($templateId, Dotdigitalgroup_Email_Helper_Transactional::MAP_COLUMN_KEY_DATAFIELD, $storeId);
     //design and send. campaign id is needed for this option
     if ($sendType == 2 && $transEnabled && $campaignId) {
         if (is_array($email)) {
             foreach ($email as $one) {
                 $this->setSentSuccess($this->designAndSend($templateId, $vars, $campaignId, $one, $storeId));
             }
         } else {
             $this->setSentSuccess($this->designAndSend($templateId, $vars, $campaignId, $email, $storeId));
         }
         return $this;
     }
     //send via connector
     if ($sendType == 1 && $transEnabled) {
         return $this->sendTransactionalForOptionViaConnector($sender, $email, $name, $vars, $storeId, $sendType);
     }
     // If Template ID is 'nosend', then simply return false
     if ($templateId == 'nosend') {
         return false;
     }
     //templates not mapped or mapped "Use System Default"
     return parent::sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
 }
开发者ID:vdimitrovv,项目名称:dotmailer-magento-extension,代码行数:40,代码来源:Template.php

示例2: sendTransactional

 /**
  * Send transactional email to recipient
  *
  * @see Mage_Core_Model_Email_Template::sendTransactional()
  * @param   string $templateId
  * @param   string|array $sender sneder information, can be declared as part of config path
  * @param   string $email recipient email
  * @param   string $name recipient name
  * @param   array $vars varianles which can be used in template
  * @param   int|null $storeId
  * @return  Mage_Core_Model_Email_Template
  */
 public function sendTransactional($templateId, $sender, $email, $name, $vars = array(), $storeId = null)
 {
     if (!Mage::helper('wfs_disable_emails')->isDisabled($templateId)) {
         return parent::sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
     } else {
         $this->setSentSuccess(true);
         return $this;
     }
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:21,代码来源:Template.php

示例3: sendTransactional

 public function sendTransactional($templateId, $sender, $email, $name, $vars = array(), $storeId = null)
 {
     if (isset($vars['order']) && !isset($vars['dealer'])) {
         $order = $vars['order'];
         $dealerId = Mage::getModel('amperm/perm')->getUserByOrder($order->getId());
         if ($dealerId) {
             $user = Mage::getModel('admin/user')->load($dealerId);
             $vars['dealer'] = $user;
         }
     }
     return parent::sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
 }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:12,代码来源:Template.php

示例4: sendTransactional

 public function sendTransactional($templateId, $sender, $email, $name, $vars = array(), $storeId = null)
 {
     if (isset($vars['order']) && !isset($vars['customer'])) {
         // will try to add customer object
         $order = $vars['order'];
         if ($order->getCustomerId()) {
             $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
             if ($customer->getId()) {
                 $vars['customer'] = $customer;
             }
         }
     }
     return parent::sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:14,代码来源:Template.php

示例5: sendTransactional

 /**
  * Send transactional email to recipient
  *
  * @param   int $templateId
  * @param   string|array $sender sneder informatio, can be declared as part of config path
  * @param   string $email recipient email
  * @param   string $name recipient name
  * @param   array $vars varianles which can be used in template
  * @param   int|null $storeId
  * @return  Mage_Core_Model_Email_Template
  */
 public function sendTransactional($templateId, $sender, $email, $name, $vars = array(), $storeId = null)
 {
     if (isset($vars['order'])) {
         $aCustomAtrrList = $this->_getCustomAttributesList($vars);
         $cfm = new Varien_Object();
         foreach ($aCustomAtrrList as $attr) {
             if (!isset($attr['attribute_code']) && isset($attr['code'])) {
                 $attr['attribute_code'] = $attr['code'];
             }
             $cfm->setData($attr['attribute_code'], $attr['value']);
             if ($attr['value'] && isset($attr['frontend_label'])) {
                 $cfm->setData($attr['attribute_code'] . '_label', $attr['frontend_label']);
             }
         }
         $vars['cfm'] = $cfm;
     }
     return parent::sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
 }
开发者ID:finelinePG,项目名称:finelink-dev,代码行数:29,代码来源:CoreEmailTemplate.php

示例6: sendTransactional

 public function sendTransactional($templateId, $sender, $email, $name, $vars = array(), $storeId = null)
 {
     $templatePath = Mage::helper('aitemails')->getPathByEmailTemplateCode('sales_email_order_template');
     $collection = Mage::getResourceSingleton('aitemails/aittemplate_collection');
     $aCollection = $collection->load()->toArray();
     $aCollection = $aCollection['items'];
     $this->load($templateId);
     foreach ($aCollection as $template) {
         $templatePath = Mage::helper('aitemails')->getPathByEmailTemplateCode($template['code']);
         if (!$this->getId() && is_numeric($templateId)) {
             $config_value = Mage::getStoreConfig($templatePath);
             if ($config_value == $templateId) {
                 $templateId = $template['code'];
             }
         }
     }
     $this->setAitmailsStoreId($storeId);
     return parent::sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:19,代码来源:Mage_Core_Model_Email_Template.php

示例7: sendReminderEmails

 /**
  * Send reminder emails
  *
  * @return Enterprise_Reminder_Model_Rule
  */
 public function sendReminderEmails()
 {
     /* @var $translate Mage_Core_Model_Translate */
     $translate = Mage::getSingleton('core/translate');
     $translate->setTranslateInline(false);
     $identity = Mage::helper('enterprise_reminder')->getEmailIdentity();
     $this->_matchCustomers();
     $limit = Mage::helper('enterprise_reminder')->getOneRunLimit();
     $recipients = $this->_getResource()->getCustomersForNotification($limit, $this->getRuleId());
     foreach ($recipients as $recipient) {
         /* @var $customer Mage_Customer_Model_Customer */
         $customer = Mage::getModel('customer/customer')->load($recipient['customer_id']);
         if (!$customer || !$customer->getId()) {
             continue;
         }
         if ($customer->getStoreId()) {
             $store = $customer->getStore();
         } else {
             $store = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore();
         }
         $storeData = $this->getStoreData($recipient['rule_id'], $store->getId());
         if (!$storeData) {
             continue;
         }
         /* @var $coupon Mage_SalesRule_Model_Coupon */
         $coupon = Mage::getModel('salesrule/coupon')->load($recipient['coupon_id']);
         $templateVars = array('store' => $store, 'coupon' => $coupon, 'customer' => $customer, 'promotion_name' => $storeData['label'], 'promotion_description' => $storeData['description']);
         $this->_mail->setDesignConfig(array('area' => 'frontend', 'store' => $store->getId()));
         $this->_mail->sendTransactional($storeData['template_id'], $identity, $customer->getEmail(), null, $templateVars, $store->getId());
         if ($this->_mail->getSentSuccess()) {
             $this->_getResource()->addNotificationLog($recipient['rule_id'], $customer->getId());
         } else {
             $this->_getResource()->updateFailedEmailsCounter($recipient['rule_id'], $customer->getId());
         }
     }
     $translate->setTranslateInline(true);
     return $this;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:43,代码来源:Rule.php

示例8: testSendTransactionalWrongId

 /**
  * @expectedException Mage_Core_Exception
  */
 public function testSendTransactionalWrongId()
 {
     $this->_model->sendTransactional('wrong_id' . uniqid(), array('name' => 'Sender Name', 'email' => 'sender@example.com'), 'recipient@example.com', 'Recipient Name');
 }
开发者ID:natxetee,项目名称:magento2,代码行数:7,代码来源:TemplateTest.php

示例9: sendTransactional

 /**
  * Send transactional email to recipient
  *
  * @param int          $templateId
  * @param string|array $sender Sender information, can be declared as part of config path
  * @param string       $email  Recipient email
  * @param string       $name   Recipient name
  * @param array        $vars   Variables which can be used in template
  * @param int|null     $storeId
  *
  * @return Mage_Core_Model_Email_Template
  */
 public function sendTransactional($templateId, $sender, $email, $name, $vars = array(), $storeId = null)
 {
     // If Template ID is 'nosend', then simply return false
     if ($templateId == 'nosend') {
         return false;
     }
     // If not set to go through Bronto, fall through to magento sending
     if (!Mage::helper($this->_helper)->canSendBronto($this, $storeId)) {
         return parent::sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
     } else {
         // If module enabled and template ID is not an instance of the api row, see if we can pull an instance
         if (!$templateId instanceof Bronto_Api_Model_Message) {
             $emailTemplate = Mage::getModel('bronto_email/template')->setDesignConfig($this->getDesignConfig()->getData());
             // If $templateId is numeric, load template by ID, else is default and should send through Magento
             if (is_numeric($templateId)) {
                 $emailTemplate->load($templateId);
             } else {
                 $this->setTemplateSendType('magento');
                 return parent::sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
             }
             // If Template doesn't have a Bronto Message ID, send through magento
             if (!$emailTemplate->getBrontoMessageId() || is_null($emailTemplate->getBrontoMessageId())) {
                 return parent::sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
             }
             $message = new Bronto_Api_Model_Message();
             $message->withId($emailTemplate->getBrontoMessageId());
             // Send through main template model
             $emailTemplate->sendTransactional($message, $sender, $email, $name, $vars, $storeId);
             return $this->setSentSuccess($emailTemplate->getSentSuccess());
         } else {
             $this->setBrontoMessageId($templateId->id);
         }
     }
     // Start the send process
     $this->setSentSuccess(false);
     if ($storeId === null && $this->getDesignConfig()->getStore()) {
         $storeId = $this->getDesignConfig()->getStore();
     }
     // If $sender is not array, it is a reference to a config setting, otherwise it should have 'name' and 'email'
     if (!is_array($sender)) {
         $this->setSenderName(Mage::getStoreConfig('trans_email/ident_' . $sender . '/name', $storeId));
         $this->setSenderEmail(Mage::getStoreConfig('trans_email/ident_' . $sender . '/email', $storeId));
     } else {
         $this->setSenderName($sender['name']);
         $this->setSenderEmail($sender['email']);
     }
     // If store is not set, set it
     if (!isset($vars['store'])) {
         $vars['store'] = Mage::app()->getStore($storeId);
     }
     // Check for Sales Rules
     if (!isset($vars['coupon']) && ($rule = $this->_getSalesRule($storeId))) {
         try {
             /** @var Mage_SalesRule_Model_Coupon $coupon */
             $coupon = $rule->acquireCoupon();
             if ($coupon) {
                 $vars['coupon'] = $coupon;
             }
         } catch (Exception $e) {
             Mage::helper($this->_helper)->writeError('  Failed loading Sales Rule with ID: ' . $rule->getId());
         }
     }
     // Send
     $this->setSentSuccess($this->send($email, $name, $vars));
     return $this;
 }
开发者ID:Rodrifer,项目名称:candyclub,代码行数:78,代码来源:Template.php


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