Wfs_DisableEmails - Version 1.0.1

Version Notes

Added uncovered sections

Download this release

Release Info

Developer Magento Core Team
Extension Wfs_DisableEmails
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Wfs/DisableEmails/Model/Email/Template/Mailer.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WebFlakeStudio
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://webflakestudio.com/WFS-LICENSE-COMMUNITY.txt
11
+ *
12
+ *
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ *
15
+ * This package designed for Magento COMMUNITY edition
16
+ * WebFlakeStudio does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * WebFlakeStudio does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ *
21
+ * DISCLAIMER
22
+ *
23
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
24
+ * versions in the future.
25
+ *
26
+ * @category Wfs
27
+ * @package Wfs_DisableEmails
28
+ * @copyright Copyright (c) 2012 WebFlakeStudio (http://webflakestudio.com)
29
+ * @license http://webflakestudio.com/WFS-LICENSE-COMMUNITY.txt
30
+ */
31
+ class Wfs_DisableEmails_Model_Email_Template_Mailer extends Mage_Core_Model_Email_Template_Mailer
32
+ {
33
+ /**
34
+ * Send all emails from email list
35
+ * @see self::$_emailInfos
36
+ *
37
+ * @return Mage_Core_Model_Email_Template_Mailer
38
+ */
39
+ public function send()
40
+ {
41
+ if (Mage::helper('wfs_disable_emails')->isDisabled($this->getTemplateId())) {
42
+ return $this;
43
+ }
44
+
45
+ $emailTemplate = Mage::getModel('core/email_template');
46
+ // Send all emails from corresponding list
47
+ while (!empty($this->_emailInfos)) {
48
+ $emailInfo = array_pop($this->_emailInfos);
49
+ // Handle "Bcc" recepients of the current email
50
+ $emailTemplate->addBcc($emailInfo->getBccEmails());
51
+ // Set required design parameters and delegate email sending to Mage_Core_Model_Email_Template
52
+ $emailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $this->getStoreId()))
53
+ ->sendTransactional(
54
+ $this->getTemplateId(),
55
+ $this->getSender(),
56
+ $emailInfo->getToEmails(),
57
+ $emailInfo->getToNames(),
58
+ $this->getTemplateParams(),
59
+ $this->getStoreId()
60
+ );
61
+ }
62
+ return $this;
63
+ }
64
+ }
app/code/community/Wfs/DisableEmails/etc/config.xml CHANGED
@@ -33,7 +33,7 @@
33
  <config>
34
  <modules>
35
  <Wfs_DisableEmails>
36
- <version>1.0.0</version>
37
  </Wfs_DisableEmails>
38
  </modules>
39
  <global>
@@ -46,6 +46,7 @@
46
  <core>
47
  <rewrite>
48
  <email_template>Wfs_DisableEmails_Model_Email_Template</email_template>
 
49
  </rewrite>
50
  </core>
51
  </models>
33
  <config>
34
  <modules>
35
  <Wfs_DisableEmails>
36
+ <version>1.0.1</version>
37
  </Wfs_DisableEmails>
38
  </modules>
39
  <global>
46
  <core>
47
  <rewrite>
48
  <email_template>Wfs_DisableEmails_Model_Email_Template</email_template>
49
+ <email_template_mailer>Wfs_DisableEmails_Model_Email_Template_Mailer</email_template_mailer>
50
  </rewrite>
51
  </core>
52
  </models>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Wfs_DisableEmails</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://webflakestudio.com/WFS-LICENSE-COMMUNITY.txt">WebFlakeStudio custom license</license>
7
  <channel>community</channel>
@@ -10,11 +10,11 @@
10
  <description>Disable Emails extension from WebFlakeStudio allows to disable specific email notifications in Magento store. In some cases it is needed to disable particular transactional email. You can do this easily with Wfs_DisableEmails module.&#xD;
11
  This extension can be used to disable all native Magento email notifications and even notifications of custom modules.&#xD;
12
  But be careful, and don't disable Remind Password notification :)</description>
13
- <notes>Stable release</notes>
14
  <authors><author><name>WebFlakeStudio</name><user>auto-converted</user><email>webflakestudio@gmail.com</email></author></authors>
15
- <date>2012-04-24</date>
16
- <time>12:31:07</time>
17
- <contents><target name="magecommunity"><dir name="Wfs"><dir name="DisableEmails"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><file name="DisableEmails.php" hash="c22d12aa471d2ff9ddad366c97dc8c62"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="44996e62b767efce86d7cbeae9ee56de"/></dir><dir name="Model"><dir name="Email"><file name="Template.php" hash="8e7d6db646896664929dc11278cc330a"/></dir></dir><dir name="etc"><file name="config.xml" hash="65bd5cddd7e50ed6e17c5fe032d9df64"/><file name="system.xml" hash="8a56a027b9e5dfa040b06c39265a3e95"/></dir><file name="WFS-LICENSE-COMMUNITY.txt" hash="5110d0940ef56f2f91bfd8da858c1c1f"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wfs_DisableEmails.xml" hash="0bbc0af646ff4c4d1e31e4bf844cc5ed"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Wfs_DisableEmails</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://webflakestudio.com/WFS-LICENSE-COMMUNITY.txt">WebFlakeStudio custom license</license>
7
  <channel>community</channel>
10
  <description>Disable Emails extension from WebFlakeStudio allows to disable specific email notifications in Magento store. In some cases it is needed to disable particular transactional email. You can do this easily with Wfs_DisableEmails module.&#xD;
11
  This extension can be used to disable all native Magento email notifications and even notifications of custom modules.&#xD;
12
  But be careful, and don't disable Remind Password notification :)</description>
13
+ <notes>Added uncovered sections</notes>
14
  <authors><author><name>WebFlakeStudio</name><user>auto-converted</user><email>webflakestudio@gmail.com</email></author></authors>
15
+ <date>2012-05-14</date>
16
+ <time>10:21:24</time>
17
+ <contents><target name="magecommunity"><dir name="Wfs"><dir name="DisableEmails"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><file name="DisableEmails.php" hash="c22d12aa471d2ff9ddad366c97dc8c62"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="44996e62b767efce86d7cbeae9ee56de"/></dir><dir name="Model"><dir name="Email"><dir name="Template"><file name="Mailer.php" hash="17218d1c3762d30a646b607d2a25a1f3"/></dir><file name="Template.php" hash="8e7d6db646896664929dc11278cc330a"/></dir></dir><dir name="etc"><file name="config.xml" hash="e1a6f10878c10c7ecd0f4a4381321143"/><file name="system.xml" hash="8a56a027b9e5dfa040b06c39265a3e95"/></dir><file name="WFS-LICENSE-COMMUNITY.txt" hash="5110d0940ef56f2f91bfd8da858c1c1f"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wfs_DisableEmails.xml" hash="0bbc0af646ff4c4d1e31e4bf844cc5ed"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>