mail_transport - Version 0.1.1.4

Version Notes

Send magento emails by protocol SMTP or save them to a files.

Download this release

Release Info

Developer Marcin Frymark
Extension mail_transport
Version 0.1.1.4
Comparing to
See all releases


Code changes from version 0.1.1.3 to 0.1.1.4

app/code/community/Alekseon/MailTransport/Block/Adminhtml/SentEmail/View/Form.php CHANGED
@@ -121,4 +121,22 @@ class Alekseon_MailTransport_Block_Adminhtml_SentEmail_View_Form extends Mage_Ad
121
  }
122
  return array();
123
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  }
121
  }
122
  return array();
123
  }
124
+
125
+ public function getTemplateType()
126
+ {
127
+ $templateType = $this->getEmail()->getTemplateType();
128
+ switch($templateType) {
129
+ case Mage_Core_Model_Template::TYPE_TEXT:
130
+ return Mage::helper('alekseon_mailTransport')->__('Text');
131
+ case Mage_Core_Model_Template::TYPE_HTML:
132
+ return Mage::helper('alekseon_mailTransport')->__('Html');
133
+ default:
134
+ return false;
135
+ }
136
+ }
137
+
138
+ public function isContentConfidential()
139
+ {
140
+ return $this->getEmail()->getIsConfidential();
141
+ }
142
  }
app/code/community/Alekseon/MailTransport/Block/Adminhtml/SentEmail/View/MailBody.php CHANGED
@@ -14,6 +14,10 @@ class Alekseon_MailTransport_Block_Adminhtml_SentEmail_View_MailBody extends Mag
14
 
15
  protected function _toHtml()
16
  {
17
- return $this->getEmail()->getMailBody();
 
 
 
 
18
  }
19
  }
14
 
15
  protected function _toHtml()
16
  {
17
+ $mailBody = $this->getEmail()->getMailBody();
18
+ if ($this->getEmail()->getTemplateType() == Mage_Core_Model_Template::TYPE_TEXT) {
19
+ $mailBody = nl2br($mailBody);
20
+ }
21
+ return $mailBody;
22
  }
23
  }
app/code/community/Alekseon/MailTransport/Model/AlekseonAdminNotification/Feed.php CHANGED
@@ -19,7 +19,11 @@ class Alekseon_MailTransport_Model_AlekseonAdminNotification_Feed extends Mage_A
19
  $this->_feedUrl = Mage::helper('alekseon_mailTransport')->getAlekseonUrl() . '/rss/magento_rss.xml';
20
  $query = '?utm_source=' . urlencode(Mage::getStoreConfig('web/unsecure/base_url'));
21
  $query .= '&utm_medium=' . urlencode('Magento Connect');
22
- $query .= '&utm_content=' . urlencode(Mage::getEdition() . ' ' . Mage::getVersion());
 
 
 
 
23
  $query .= '&utm_term=' . urlencode(implode(',', $this->_getAlekseonInstalledModules()));
24
 
25
  $this->_feedUrl .= $query;
19
  $this->_feedUrl = Mage::helper('alekseon_mailTransport')->getAlekseonUrl() . '/rss/magento_rss.xml';
20
  $query = '?utm_source=' . urlencode(Mage::getStoreConfig('web/unsecure/base_url'));
21
  $query .= '&utm_medium=' . urlencode('Magento Connect');
22
+ if (method_exists('Mage', 'getEdition')) {
23
+ $query .= '&utm_content=' . urlencode(Mage::getEdition() . ' ' . Mage::getVersion());
24
+ } else {
25
+ $query .= '&utm_content=' . urlencode(Mage::getVersion());
26
+ }
27
  $query .= '&utm_term=' . urlencode(implode(',', $this->_getAlekseonInstalledModules()));
28
 
29
  $this->_feedUrl .= $query;
app/code/community/Alekseon/MailTransport/Model/Email/Template.php CHANGED
@@ -9,10 +9,29 @@ class Alekseon_MailTransport_Model_Email_Template extends Mage_Core_Model_Email_
9
  {
10
  protected $_sentEmailModel;
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  public function getProcessedTemplate(array $variables = array())
13
  {
14
  $processedResult = parent::getProcessedTemplate($variables);
15
- $this->getSentEmailModel()->setMailBody($processedResult);
 
 
 
 
 
 
16
  return $processedResult;
17
  }
18
 
@@ -149,6 +168,7 @@ class Alekseon_MailTransport_Model_Email_Template extends Mage_Core_Model_Email_
149
  $name = isset($names[$key]) ? $names[$key] : null;
150
  $this->getSentEmailModel()->addReceipient($email, $name);
151
  }
 
152
  $this->getSentEmailModel()->setSentAt(Mage::getSingleton('core/date')->gmtDate());
153
  $this->getSentEmailModel()->setStatus($result);
154
  $this->getSentEmailModel()->save();
9
  {
10
  protected $_sentEmailModel;
11
 
12
+ protected function _isTemplateConfidential()
13
+ {
14
+ $confidentialTemplatesConfig = Mage::getStoreConfig('alekseon_mailTransport/sent_email_history/confidential_templates');
15
+
16
+ $confidentialTemplates = explode(',', $confidentialTemplatesConfig);
17
+
18
+ if (in_array($this->getTemplateId(), $confidentialTemplates)) {
19
+ return true;
20
+ }
21
+
22
+ return false;
23
+ }
24
+
25
  public function getProcessedTemplate(array $variables = array())
26
  {
27
  $processedResult = parent::getProcessedTemplate($variables);
28
+
29
+ if ($this->_isTemplateConfidential()) {
30
+ $this->getSentEmailModel()->setIsConfidential(true);
31
+ } else {
32
+ $this->getSentEmailModel()->setMailBody($processedResult);
33
+ }
34
+
35
  return $processedResult;
36
  }
37
 
168
  $name = isset($names[$key]) ? $names[$key] : null;
169
  $this->getSentEmailModel()->addReceipient($email, $name);
170
  }
171
+ $this->getSentEmailModel()->setTemplateType($this->getTemplateType());
172
  $this->getSentEmailModel()->setSentAt(Mage::getSingleton('core/date')->gmtDate());
173
  $this->getSentEmailModel()->setStatus($result);
174
  $this->getSentEmailModel()->save();
app/code/community/Alekseon/MailTransport/Model/System/Config/Source/AllTemplates.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Marcin Frymark
4
+ * @email contact@alekseon.com
5
+ * @company Alekseon
6
+ * @website www.alekseon.com
7
+ */
8
+ class Alekseon_MailTransport_Model_System_Config_Source_AllTemplates
9
+ {
10
+ protected $_options;
11
+
12
+ public function toOptionArray()
13
+ {
14
+ if (is_null($this->_options)) {
15
+ $emailTemplateModel = Mage::getModel('core/email_template');
16
+ $this->options = array();
17
+
18
+ $idLabel = array();
19
+ foreach ($emailTemplateModel->getDefaultTemplates() as $templateId => $row) {
20
+ if (isset($row['@']) && isset($row['@']['module'])) {
21
+ $module = $row['@']['module'];
22
+ } else {
23
+ $module = 'adminhtml';
24
+ }
25
+ $idLabel[$templateId] = Mage::helper($module)->__($row['label']);
26
+ }
27
+
28
+ foreach ($emailTemplateModel->getCollection() as $template) {
29
+ $idLabel[$template->getId()] = $template->getTemplateCode();
30
+ }
31
+
32
+ asort($idLabel);
33
+ foreach ($idLabel as $templateId => $label) {
34
+ $this->_options[] = array('value' => $templateId, 'label' => $label);
35
+ }
36
+ }
37
+
38
+ return $this->_options;
39
+ }
40
+ }
app/code/community/Alekseon/MailTransport/Model/System/Config/Source/EncryptionProtocols.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
- /**
3
- * @author Marcin Frymark
4
- * @email contact@alekseon.com
5
- * @company Alekseon
6
- * @website www.alekseon.com
7
- */
8
- class Alekseon_MailTransport_Model_System_Config_Source_EncryptionProtocols
9
- {
10
- const ENCRYPTION_PROTOCOL_SSL = 'ssl';
11
- const ENCRYPTION_PROTOCOL_TLS = 'tls';
12
-
13
- public function toOptionArray()
14
- {
15
- $helper = Mage::helper('alekseon_mailTransport');
16
- $options = array(
17
- 0 => $helper->__('No Encryption'),
18
- self::ENCRYPTION_PROTOCOL_SSL => $helper->__('SSL - Secure Sockets Layer'),
19
- self::ENCRYPTION_PROTOCOL_TLS => $helper->__('TLS - Transport Layer Security'),
20
- );
21
- return $options;
22
- }
23
-
24
  }
1
+ <?php
2
+ /**
3
+ * @author Marcin Frymark
4
+ * @email contact@alekseon.com
5
+ * @company Alekseon
6
+ * @website www.alekseon.com
7
+ */
8
+ class Alekseon_MailTransport_Model_System_Config_Source_EncryptionProtocols
9
+ {
10
+ const ENCRYPTION_PROTOCOL_SSL = 'ssl';
11
+ const ENCRYPTION_PROTOCOL_TLS = 'tls';
12
+
13
+ public function toOptionArray()
14
+ {
15
+ $helper = Mage::helper('alekseon_mailTransport');
16
+ $options = array(
17
+ 0 => $helper->__('No Encryption'),
18
+ self::ENCRYPTION_PROTOCOL_SSL => $helper->__('SSL - Secure Sockets Layer'),
19
+ self::ENCRYPTION_PROTOCOL_TLS => $helper->__('TLS - Transport Layer Security'),
20
+ );
21
+ return $options;
22
+ }
23
+
24
  }
app/code/community/Alekseon/MailTransport/Model/System/Config/Source/MailTransportTypes.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
- /**
3
- * @author Marcin Frymark
4
- * @email contact@alekseon.com
5
- * @company Alekseon
6
- * @website www.alekseon.com
7
- */
8
- class Alekseon_MailTransport_Model_System_Config_Source_MailTransportTypes
9
- {
10
- const MAIL_TARNSPORT_TYPE_DEFAULT = 0;
11
- const MAIL_TARNSPORT_TYPE_SMTP = 1;
12
- const MAIL_TARNSPORT_TYPE_FILE = 2;
13
-
14
- public function toOptionArray($short = false)
15
- {
16
- $helper = Mage::helper('alekseon_mailTransport');
17
- if ($short) {
18
- $options = array(
19
- self::MAIL_TARNSPORT_TYPE_DEFAULT => $helper->__('PHP'),
20
- self::MAIL_TARNSPORT_TYPE_SMTP => $helper->__('SMTP'),
21
- self::MAIL_TARNSPORT_TYPE_FILE => $helper->__('File'),
22
- );
23
- } else {
24
- $options = array(
25
- self::MAIL_TARNSPORT_TYPE_DEFAULT => $helper->__('PHP - PHP internal mail()'),
26
- self::MAIL_TARNSPORT_TYPE_SMTP => $helper->__('SMTP - Simple Mail Transfer Protocol'),
27
- self::MAIL_TARNSPORT_TYPE_FILE => $helper->__('File - Saves e-mail message to a file.'),
28
- );
29
- }
30
- return $options;
31
- }
32
-
33
  }
1
+ <?php
2
+ /**
3
+ * @author Marcin Frymark
4
+ * @email contact@alekseon.com
5
+ * @company Alekseon
6
+ * @website www.alekseon.com
7
+ */
8
+ class Alekseon_MailTransport_Model_System_Config_Source_MailTransportTypes
9
+ {
10
+ const MAIL_TARNSPORT_TYPE_DEFAULT = 0;
11
+ const MAIL_TARNSPORT_TYPE_SMTP = 1;
12
+ const MAIL_TARNSPORT_TYPE_FILE = 2;
13
+
14
+ public function toOptionArray($short = false)
15
+ {
16
+ $helper = Mage::helper('alekseon_mailTransport');
17
+ if ($short) {
18
+ $options = array(
19
+ self::MAIL_TARNSPORT_TYPE_DEFAULT => $helper->__('PHP'),
20
+ self::MAIL_TARNSPORT_TYPE_SMTP => $helper->__('SMTP'),
21
+ self::MAIL_TARNSPORT_TYPE_FILE => $helper->__('File'),
22
+ );
23
+ } else {
24
+ $options = array(
25
+ self::MAIL_TARNSPORT_TYPE_DEFAULT => $helper->__('PHP - PHP internal mail()'),
26
+ self::MAIL_TARNSPORT_TYPE_SMTP => $helper->__('SMTP - Simple Mail Transfer Protocol'),
27
+ self::MAIL_TARNSPORT_TYPE_FILE => $helper->__('File - Saves e-mail message to a file.'),
28
+ );
29
+ }
30
+ return $options;
31
+ }
32
+
33
  }
app/code/community/Alekseon/MailTransport/Model/System/Config/Source/SmtpAuthModes.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
- /**
3
- * @author Marcin Frymark
4
- * @email contact@alekseon.com
5
- * @company Alekseon
6
- * @website www.alekseon.com
7
- */
8
- class Alekseon_MailTransport_Model_System_Config_Source_SmtpAuthModes
9
- {
10
- const SMTP_AUTH_MODE_LOGIN = 'login';
11
- const SMTP_AUTH_MODE_PLAIN = 'plain';
12
- const SMTP_AUTH_MODE_CRAMMD5 = 'cramm5';
13
-
14
- public function toOptionArray()
15
- {
16
- $helper = Mage::helper('alekseon_mailTransport');
17
- $options = array(
18
- self::SMTP_AUTH_MODE_LOGIN => $helper->__('Login'),
19
- self::SMTP_AUTH_MODE_PLAIN => $helper->__('Plain'),
20
- self::SMTP_AUTH_MODE_CRAMMD5 => $helper->__('Cram-md5'),
21
- );
22
- return $options;
23
- }
24
-
25
  }
1
+ <?php
2
+ /**
3
+ * @author Marcin Frymark
4
+ * @email contact@alekseon.com
5
+ * @company Alekseon
6
+ * @website www.alekseon.com
7
+ */
8
+ class Alekseon_MailTransport_Model_System_Config_Source_SmtpAuthModes
9
+ {
10
+ const SMTP_AUTH_MODE_LOGIN = 'login';
11
+ const SMTP_AUTH_MODE_PLAIN = 'plain';
12
+ const SMTP_AUTH_MODE_CRAMMD5 = 'cramm5';
13
+
14
+ public function toOptionArray()
15
+ {
16
+ $helper = Mage::helper('alekseon_mailTransport');
17
+ $options = array(
18
+ self::SMTP_AUTH_MODE_LOGIN => $helper->__('Login'),
19
+ self::SMTP_AUTH_MODE_PLAIN => $helper->__('Plain'),
20
+ self::SMTP_AUTH_MODE_CRAMMD5 => $helper->__('Cram-md5'),
21
+ );
22
+ return $options;
23
+ }
24
+
25
  }
app/code/community/Alekseon/MailTransport/etc/config.xml CHANGED
@@ -1 +1 @@
1
- <?xml version="1.0"?>
2
  * @author Marcin Frymark
3
  * @email contact@alekseon.com
4
  * @company Alekseon
5
  * @website www.alekseon.com
6
  */
7
- ->
8
  <modules>
9
  <Alekseon_MailTransport>
10
  <version>0.1.1</version>
11
  </Alekseon_MailTransport>
12
  </modules>
13
  <global>
14
  <models>
15
  <alekseon_mailTransport>
16
  <class>Alekseon_MailTransport_Model</class>
17
  <resourceModel>alekseon_mailtransport_resource</resourceModel>
18
  </alekseon_mailTransport>
19
  <alekseon_mailtransport_resource>
20
  <class>Alekseon_MailTransport_Model_Resource</class>
21
  <sentemail>
22
  <table>alekseon_mailtransport_sentemail</table>
23
  </sentemail>
24
  <sentemail_correspondent>
25
  <table>alekseon_mailtransport_sentemail_correspondent</table>
26
  </sentemail_correspondent>
27
  </entities>
28
  </alekseon_mailtransport_resource>
29
  <core>
30
  <rewrite>
31
  <email_template>Alekseon_MailTransport_Model_Email_Template</email_template>
32
  </rewrite>
33
  </core>
34
  </models>
35
  <blocks>
36
  <alekseon_mailTransport>
37
  <class>Alekseon_MailTransport_Block</class>
38
  </alekseon_mailTransport>
39
  </blocks>
40
  <helpers>
41
  <alekseon_mailTransport>
42
  <class>Alekseon_MailTransport_Helper</class>
43
  </alekseon_mailTransport>
44
  </helpers>
45
  <resources>
46
  <alekseon_mailtransport_setup>
47
  <setup>
48
  <module>Alekseon_MailTransport</module>
49
  <class>Mage_Core_Model_Resource_Setup</class>
50
  </setup>
51
  </alekseon_mailtransport_setup>
52
  </resources>
53
  </global>
54
  <adminhtml>
55
  <layout>
56
  <updates>
57
  <alekseon_mailTransport>
58
  <file>alekseon/mailTransport.xml</file>
59
  </alekseon_mailTransport>
60
  </updates>
61
  </layout>
62
  <events>
63
  <controller_action_predispatch>
64
  <observers>
65
  <alekseon_adminNotification>
66
  <class>alekseon_mailTransport/alekseonAdminNotification_observer</class>
67
  <method>preDispatch</method>
68
  </alekseon_adminNotification>
69
  </observers>
70
  </controller_action_predispatch>
71
  </events>
72
  </adminhtml>
73
  <admin>
74
  <routers>
75
  <adminhtml>
76
  <args>
77
  <modules>
78
  <alekseon_mailTransport before="Mage_Adminhtml">Alekseon_MailTransport_Adminhtml</alekseon_mailTransport>
79
  </modules>
80
  </args>
81
  </adminhtml>
82
  </routers>
83
  </admin>
84
  <crontab>
85
  <jobs>
86
  <alekseon_remove_old_sent_emails>
87
  <schedule>
88
  <cron_expr>*/5 * * * *</cron_expr>
89
  </schedule>
90
  <run>
91
  <model>alekseon_mailTransport/observer::removeOldSentEmails</model>
92
  </run>
93
  </alekseon_remove_old_sent_emails>
94
  </jobs>
95
  </crontab>
96
  <default>
97
  <alekseon_adminNotification>
98
  <general>
99
  <enabled>1</enabled>
100
  <frequency>12</frequency>
101
  </general>
102
  </alekseon_adminNotification>
103
  <alekseon_mailTransport>
104
  <general>
105
  <smtp_password backend_model="adminhtml/system_config_backend_encrypted"/>
106
  </general>
107
  <sent_email_history>
108
  <remove_successed_after>30</remove_successed_after>
109
  <remove_failed_after>30</remove_failed_after>
110
  </sent_email_history>
111
  </alekseon_mailTransport>
112
  </default>
 
113
  * @author Marcin Frymark
114
  * @email contact@alekseon.com
115
  * @company Alekseon
116
  * @website www.alekseon.com
117
  */
118
- ->
119
  <modules>
120
  <Alekseon_MailTransport>
121
  <version>0.1.3</version>
122
  </Alekseon_MailTransport>
123
  </modules>
124
  <global>
125
  <models>
126
  <alekseon_mailTransport>
127
  <class>Alekseon_MailTransport_Model</class>
128
  <resourceModel>alekseon_mailtransport_resource</resourceModel>
129
  </alekseon_mailTransport>
130
  <alekseon_mailtransport_resource>
131
  <class>Alekseon_MailTransport_Model_Resource</class>
132
  <sentemail>
133
  <table>alekseon_mailtransport_sentemail</table>
134
  </sentemail>
135
  <sentemail_correspondent>
136
  <table>alekseon_mailtransport_sentemail_correspondent</table>
137
  </sentemail_correspondent>
138
  </entities>
139
  </alekseon_mailtransport_resource>
140
  <core>
141
  <rewrite>
142
  <email_template>Alekseon_MailTransport_Model_Email_Template</email_template>
143
  </rewrite>
144
  </core>
145
  </models>
146
  <blocks>
147
  <alekseon_mailTransport>
148
  <class>Alekseon_MailTransport_Block</class>
149
  </alekseon_mailTransport>
150
  </blocks>
151
  <helpers>
152
  <alekseon_mailTransport>
153
  <class>Alekseon_MailTransport_Helper</class>
154
  </alekseon_mailTransport>
155
  </helpers>
156
  <resources>
157
  <alekseon_mailtransport_setup>
158
  <setup>
159
  <module>Alekseon_MailTransport</module>
160
  <class>Mage_Core_Model_Resource_Setup</class>
161
  </setup>
162
  </alekseon_mailtransport_setup>
163
  </resources>
164
  </global>
165
  <adminhtml>
166
  <layout>
167
  <updates>
168
  <alekseon_mailTransport>
169
  <file>alekseon/mailTransport.xml</file>
170
  </alekseon_mailTransport>
171
  </updates>
172
  </layout>
173
  <events>
174
  <controller_action_predispatch>
175
  <observers>
176
  <alekseon_adminNotification>
177
  <class>alekseon_mailTransport/alekseonAdminNotification_observer</class>
178
  <method>preDispatch</method>
179
  </alekseon_adminNotification>
180
  </observers>
181
  </controller_action_predispatch>
182
  </events>
183
  </adminhtml>
184
  <admin>
185
  <routers>
186
  <adminhtml>
187
  <args>
188
  <modules>
189
  <alekseon_mailTransport before="Mage_Adminhtml">Alekseon_MailTransport_Adminhtml</alekseon_mailTransport>
190
  </modules>
191
  </args>
192
  </adminhtml>
193
  </routers>
194
  </admin>
195
  <crontab>
196
  <jobs>
197
  <alekseon_remove_old_sent_emails>
198
  <schedule>
199
  <cron_expr>0 0 * * *</cron_expr>
200
  </schedule>
201
  <run>
202
  <model>alekseon_mailTransport/observer::removeOldSentEmails</model>
203
  </run>
204
  </alekseon_remove_old_sent_emails>
205
  </jobs>
206
  </crontab>
207
  <default>
208
  <alekseon_adminNotification>
209
  <general>
210
  <enabled>1</enabled>
211
  <frequency>12</frequency>
212
  </general>
213
  </alekseon_adminNotification>
214
  <alekseon_mailTransport>
215
  <general>
216
  <smtp_password backend_model="adminhtml/system_config_backend_encrypted"/>
217
  </general>
218
  <sent_email_history>
219
  <remove_successed_after>30</remove_successed_after>
220
  <remove_failed_after>30</remove_failed_after>
221
  <confidential_templates>admin_emails_forgot_email_template,customer_create_account_email_template,customer_create_account_email_confirmation_template,customer_password_forgot_email_template,customer_password_remind_email_template</confidential_templates>
222
  </sent_email_history>
223
  </alekseon_mailTransport>
224
  </default>
 
1
  * @author Marcin Frymark
2
  * @email contact@alekseon.com
3
  * @company Alekseon
4
  * @website www.alekseon.com
5
  */
 
6
  <modules>
7
  <Alekseon_MailTransport>
8
  <version>0.1.1</version>
9
  </Alekseon_MailTransport>
10
  </modules>
11
  <global>
12
  <models>
13
  <alekseon_mailTransport>
14
  <class>Alekseon_MailTransport_Model</class>
15
  <resourceModel>alekseon_mailtransport_resource</resourceModel>
16
  </alekseon_mailTransport>
17
  <alekseon_mailtransport_resource>
18
  <class>Alekseon_MailTransport_Model_Resource</class>
19
  <sentemail>
20
  <table>alekseon_mailtransport_sentemail</table>
21
  </sentemail>
22
  <sentemail_correspondent>
23
  <table>alekseon_mailtransport_sentemail_correspondent</table>
24
  </sentemail_correspondent>
25
  </entities>
26
  </alekseon_mailtransport_resource>
27
  <core>
28
  <rewrite>
29
  <email_template>Alekseon_MailTransport_Model_Email_Template</email_template>
30
  </rewrite>
31
  </core>
32
  </models>
33
  <blocks>
34
  <alekseon_mailTransport>
35
  <class>Alekseon_MailTransport_Block</class>
36
  </alekseon_mailTransport>
37
  </blocks>
38
  <helpers>
39
  <alekseon_mailTransport>
40
  <class>Alekseon_MailTransport_Helper</class>
41
  </alekseon_mailTransport>
42
  </helpers>
43
  <resources>
44
  <alekseon_mailtransport_setup>
45
  <setup>
46
  <module>Alekseon_MailTransport</module>
47
  <class>Mage_Core_Model_Resource_Setup</class>
48
  </setup>
49
  </alekseon_mailtransport_setup>
50
  </resources>
51
  </global>
52
  <adminhtml>
53
  <layout>
54
  <updates>
55
  <alekseon_mailTransport>
56
  <file>alekseon/mailTransport.xml</file>
57
  </alekseon_mailTransport>
58
  </updates>
59
  </layout>
60
  <events>
61
  <controller_action_predispatch>
62
  <observers>
63
  <alekseon_adminNotification>
64
  <class>alekseon_mailTransport/alekseonAdminNotification_observer</class>
65
  <method>preDispatch</method>
66
  </alekseon_adminNotification>
67
  </observers>
68
  </controller_action_predispatch>
69
  </events>
70
  </adminhtml>
71
  <admin>
72
  <routers>
73
  <adminhtml>
74
  <args>
75
  <modules>
76
  <alekseon_mailTransport before="Mage_Adminhtml">Alekseon_MailTransport_Adminhtml</alekseon_mailTransport>
77
  </modules>
78
  </args>
79
  </adminhtml>
80
  </routers>
81
  </admin>
82
  <crontab>
83
  <jobs>
84
  <alekseon_remove_old_sent_emails>
85
  <schedule>
86
  <cron_expr>*/5 * * * *</cron_expr>
87
  </schedule>
88
  <run>
89
  <model>alekseon_mailTransport/observer::removeOldSentEmails</model>
90
  </run>
91
  </alekseon_remove_old_sent_emails>
92
  </jobs>
93
  </crontab>
94
  <default>
95
  <alekseon_adminNotification>
96
  <general>
97
  <enabled>1</enabled>
98
  <frequency>12</frequency>
99
  </general>
100
  </alekseon_adminNotification>
101
  <alekseon_mailTransport>
102
  <general>
103
  <smtp_password backend_model="adminhtml/system_config_backend_encrypted"/>
104
  </general>
105
  <sent_email_history>
106
  <remove_successed_after>30</remove_successed_after>
107
  <remove_failed_after>30</remove_failed_after>
108
  </sent_email_history>
109
  </alekseon_mailTransport>
110
  </default>
111
+ <?xml version="1.0"?>
112
  * @author Marcin Frymark
113
  * @email contact@alekseon.com
114
  * @company Alekseon
115
  * @website www.alekseon.com
116
  */
 
117
  <modules>
118
  <Alekseon_MailTransport>
119
  <version>0.1.3</version>
120
  </Alekseon_MailTransport>
121
  </modules>
122
  <global>
123
  <models>
124
  <alekseon_mailTransport>
125
  <class>Alekseon_MailTransport_Model</class>
126
  <resourceModel>alekseon_mailtransport_resource</resourceModel>
127
  </alekseon_mailTransport>
128
  <alekseon_mailtransport_resource>
129
  <class>Alekseon_MailTransport_Model_Resource</class>
130
  <sentemail>
131
  <table>alekseon_mailtransport_sentemail</table>
132
  </sentemail>
133
  <sentemail_correspondent>
134
  <table>alekseon_mailtransport_sentemail_correspondent</table>
135
  </sentemail_correspondent>
136
  </entities>
137
  </alekseon_mailtransport_resource>
138
  <core>
139
  <rewrite>
140
  <email_template>Alekseon_MailTransport_Model_Email_Template</email_template>
141
  </rewrite>
142
  </core>
143
  </models>
144
  <blocks>
145
  <alekseon_mailTransport>
146
  <class>Alekseon_MailTransport_Block</class>
147
  </alekseon_mailTransport>
148
  </blocks>
149
  <helpers>
150
  <alekseon_mailTransport>
151
  <class>Alekseon_MailTransport_Helper</class>
152
  </alekseon_mailTransport>
153
  </helpers>
154
  <resources>
155
  <alekseon_mailtransport_setup>
156
  <setup>
157
  <module>Alekseon_MailTransport</module>
158
  <class>Mage_Core_Model_Resource_Setup</class>
159
  </setup>
160
  </alekseon_mailtransport_setup>
161
  </resources>
162
  </global>
163
  <adminhtml>
164
  <layout>
165
  <updates>
166
  <alekseon_mailTransport>
167
  <file>alekseon/mailTransport.xml</file>
168
  </alekseon_mailTransport>
169
  </updates>
170
  </layout>
171
  <events>
172
  <controller_action_predispatch>
173
  <observers>
174
  <alekseon_adminNotification>
175
  <class>alekseon_mailTransport/alekseonAdminNotification_observer</class>
176
  <method>preDispatch</method>
177
  </alekseon_adminNotification>
178
  </observers>
179
  </controller_action_predispatch>
180
  </events>
181
  </adminhtml>
182
  <admin>
183
  <routers>
184
  <adminhtml>
185
  <args>
186
  <modules>
187
  <alekseon_mailTransport before="Mage_Adminhtml">Alekseon_MailTransport_Adminhtml</alekseon_mailTransport>
188
  </modules>
189
  </args>
190
  </adminhtml>
191
  </routers>
192
  </admin>
193
  <crontab>
194
  <jobs>
195
  <alekseon_remove_old_sent_emails>
196
  <schedule>
197
  <cron_expr>0 0 * * *</cron_expr>
198
  </schedule>
199
  <run>
200
  <model>alekseon_mailTransport/observer::removeOldSentEmails</model>
201
  </run>
202
  </alekseon_remove_old_sent_emails>
203
  </jobs>
204
  </crontab>
205
  <default>
206
  <alekseon_adminNotification>
207
  <general>
208
  <enabled>1</enabled>
209
  <frequency>12</frequency>
210
  </general>
211
  </alekseon_adminNotification>
212
  <alekseon_mailTransport>
213
  <general>
214
  <smtp_password backend_model="adminhtml/system_config_backend_encrypted"/>
215
  </general>
216
  <sent_email_history>
217
  <remove_successed_after>30</remove_successed_after>
218
  <remove_failed_after>30</remove_failed_after>
219
  <confidential_templates>admin_emails_forgot_email_template,customer_create_account_email_template,customer_create_account_email_confirmation_template,customer_password_forgot_email_template,customer_password_remind_email_template</confidential_templates>
220
  </sent_email_history>
221
  </alekseon_mailTransport>
222
  </default>
app/code/community/Alekseon/MailTransport/etc/system.xml CHANGED
@@ -202,6 +202,16 @@
202
  <show_in_store>0</show_in_store>
203
  <comment>In days. Be sure that cron is added to your cron tab.</comment>
204
  </remove_failed_after>
 
 
 
 
 
 
 
 
 
 
205
  </fields>
206
  </sent_email_history>
207
  </groups>
202
  <show_in_store>0</show_in_store>
203
  <comment>In days. Be sure that cron is added to your cron tab.</comment>
204
  </remove_failed_after>
205
+ <confidential_templates translate="label comment">
206
+ <label>Select Confidential Templates</label>
207
+ <frontend_type>multiselect</frontend_type>
208
+ <source_model>alekseon_mailTransport/system_config_source_allTemplates</source_model>
209
+ <sort_order>50</sort_order>
210
+ <show_in_default>1</show_in_default>
211
+ <show_in_website>0</show_in_website>
212
+ <show_in_store>0</show_in_store>
213
+ <comment>Content of selected templates is not saved.</comment>
214
+ </confidential_templates>
215
  </fields>
216
  </sent_email_history>
217
  </groups>
app/code/community/Alekseon/MailTransport/sql/alekseon_mailtransport_setup/mysql4-upgrade-0.1.1-0.1.2.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Marcin Frymark
4
+ * @email contact@alekseon.com
5
+ * @company Alekseon
6
+ * @website www.alekseon.com
7
+ */
8
+ $installer = $this;
9
+ $installer->startSetup();
10
+ $installer->run("
11
+ ALTER TABLE `{$this->getTable('alekseon_mailTransport/sentemail')}` ADD `template_type` smallint(5) unsigned DEFAULT 0;
12
+ ");
13
+ $installer->endSetup();
app/code/community/Alekseon/MailTransport/sql/alekseon_mailtransport_setup/mysql4-upgrade-0.1.2-0.1.3.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Marcin Frymark
4
+ * @email contact@alekseon.com
5
+ * @company Alekseon
6
+ * @website www.alekseon.com
7
+ */
8
+ $installer = $this;
9
+ $installer->startSetup();
10
+ $installer->run("
11
+ ALTER TABLE `{$this->getTable('alekseon_mailTransport/sentemail')}` ADD `is_confidential` smallint(5) unsigned DEFAULT 0;
12
+ ");
13
+ $installer->endSetup();
app/design/adminhtml/default/default/template/alekseon/mailTransport/sentEmail/view/form.phtml CHANGED
@@ -47,6 +47,12 @@
47
  <td class="label"><label><?php echo Mage::helper('alekseon_mailTransport')->__('Used Template') ?></label></td>
48
  <td class="value"><strong><?php echo $this->getUsedTemplate() ?></strong></td>
49
  </tr>
 
 
 
 
 
 
50
  </table>
51
  </div>
52
  </div>
@@ -97,8 +103,12 @@
97
  <h4 class="icon-head head-account"><?php echo Mage::helper('alekseon_mailTransport')->__('Mail Body') ?></h4>
98
  </div>
99
  <div class="fieldset">
100
- <iframe src="<?php echo $this->getMailBodyIframeUrl() ?>" frameborder="1" style="width:100%; height:600px;">
101
- <p><?php echo $this->__('Your browser does not support iframes.') ?></p>
102
- </iframe>
 
 
 
 
103
  </div>
104
  </div>
47
  <td class="label"><label><?php echo Mage::helper('alekseon_mailTransport')->__('Used Template') ?></label></td>
48
  <td class="value"><strong><?php echo $this->getUsedTemplate() ?></strong></td>
49
  </tr>
50
+ <?php if ($this->getTemplateType()): ?>
51
+ <tr>
52
+ <td class="label"><label><?php echo Mage::helper('alekseon_mailTransport')->__('Template Type') ?></label></td>
53
+ <td class="value"><strong><?php echo $this->getTemplateType() ?></strong></td>
54
+ </tr>
55
+ <?php endif ?>
56
  </table>
57
  </div>
58
  </div>
103
  <h4 class="icon-head head-account"><?php echo Mage::helper('alekseon_mailTransport')->__('Mail Body') ?></h4>
104
  </div>
105
  <div class="fieldset">
106
+ <?php if ($this->isContentConfidential()): ?>
107
+ <?php echo Mage::helper('alekseon_mailTransport')->__('Content of this email is confidential.') ?>
108
+ <?php else: ?>
109
+ <iframe src="<?php echo $this->getMailBodyIframeUrl() ?>" frameborder="1" style="width:100%; height:600px;">
110
+ <p><?php echo $this->__('Your browser does not support iframes.') ?></p>
111
+ </iframe>
112
+ <?php endif ?>
113
  </div>
114
  </div>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>mail_transport</name>
4
- <version>0.1.1.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Send magento emails by protocol SMTP or save them to a files.</description>
11
  <notes>Send magento emails by protocol SMTP or save them to a files.</notes>
12
  <authors><author><name>Marcin Frymark</name><user>Alekseon</user><email>contact@alekseon.com</email></author></authors>
13
- <date>2014-05-23</date>
14
- <time>08:08:53</time>
15
- <contents><target name="magecommunity"><dir name="Alekseon"><dir name="MailTransport"><dir><dir name="Block"><dir name="Adminhtml"><dir name="SentEmail"><dir name="Grid"><dir name="Renderer"><file name="Receipient.php" hash="88a5e395a965ccae580d84ad0072b08e"/></dir></dir><file name="Grid.php" hash="64407523f244a2bce1a1c72ace24b2ac"/><file name="TopMessage.php" hash="80036003eeab72028e67c8c07f4aa52d"/><dir name="View"><file name="Form.php" hash="1d449bba45a837b23fd65027bb8dee3c"/><file name="MailBody.php" hash="d5428e3ac38e5ac53456504c72f71aee"/></dir><file name="View.php" hash="e3f941aad29a565e8f7916e237b30c0a"/></dir><file name="SentEmail.php" hash="578c135cc0f4b9bc3ccc01e745e3df2e"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="AlekseonLogo.php" hash="f51973c6b6547da6d3c4662a7fbb6566"/><file name="AlekseonNotification.php" hash="51f024aaf7825e876064ed8c2736c0bb"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f6539af5c617bc24c000d5d22e9ede3f"/></dir><dir name="Model"><dir name="AlekseonAdminNotification"><file name="Feed.php" hash="aaf8c072689181202e0c561beabc54b3"/><file name="Observer.php" hash="f44011324cad1c5284d0ea68a6267020"/></dir><dir name="Email"><file name="Template.php" hash="62f6ea97ebe9d61d242067ee4e3f8ffb"/></dir><file name="Observer.php" hash="cb32eb694fba1e53c2396c0b4398ebf0"/><dir name="Resource"><dir name="SentEmail"><file name="Collection.php" hash="bf1c29041caa2d4614e7894297b55b47"/><dir name="Correspondent"><file name="Collection.php" hash="c4df13aea0717ba228f2b206d71cdc0a"/></dir><file name="Correspondent.php" hash="e4304608fedd99d74e3720ba40ab5811"/></dir><file name="SentEmail.php" hash="3b4302ca7d3c9c9c416dc6d1559847fd"/></dir><dir name="SentEmail"><file name="Correspondent.php" hash="79ce35e0cc043ef088cad17afe87e5b1"/></dir><file name="SentEmail.php" hash="bf53e13806cafd1371f03b78ff8746a0"/><dir name="System"><dir name="Config"><dir name="Source"><file name="EncryptionProtocols.php" hash="71dfa161d404dc77be304c9946e7318e"/><file name="MailTransportTypes.php" hash="d5a09e646a0fad150e8604f1408014df"/><file name="SmtpAuthModes.php" hash="6b30e126782cdc9bb93755c179c06fc4"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="MailTransport"><file name="SentEmailsHistoryController.php" hash="8857976b524cff7451f3fdeeae013932"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="0a84d9392de6dd9ab91fc7cc6b35cc0e"/><file name="config.xml" hash="599ae179cfad391f6ef698cea3616451"/><file name="system.xml" hash="8ab1c78e4ffa9c2c9991b1a9a57b9a07"/></dir><dir name="sql"><dir name="alekseon_mailtransport_setup"><file name="mysql4-install-0.1.1.php" hash="e9eab66079a531256d2db8a0895d5d2d"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Alekseon_MailTransport.xml" hash="e99dcf95b0657403cec683729a620450"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="alekseon"><file name="mailTransport.xml" hash="052b7956a3fb7910f5dd29829fc112c7"/></dir></dir><dir name="template"><dir name="alekseon"><dir name="mailTransport"><dir name="sentEmail"><file name="topMessage.phtml" hash="a9440740f61ea7767406108f9011c07c"/><dir name="view"><file name="form.phtml" hash="28c68fd3ac225ef098e17fc73dba4fc8"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>mail_transport</name>
4
+ <version>0.1.1.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>Send magento emails by protocol SMTP or save them to a files.</description>
11
  <notes>Send magento emails by protocol SMTP or save them to a files.</notes>
12
  <authors><author><name>Marcin Frymark</name><user>Alekseon</user><email>contact@alekseon.com</email></author></authors>
13
+ <date>2014-06-29</date>
14
+ <time>16:06:43</time>
15
+ <contents><target name="magecommunity"><dir name="Alekseon"><dir name="MailTransport"><dir><dir name="Block"><dir name="Adminhtml"><dir name="SentEmail"><dir name="Grid"><dir name="Renderer"><file name="Receipient.php" hash="88a5e395a965ccae580d84ad0072b08e"/></dir></dir><file name="Grid.php" hash="64407523f244a2bce1a1c72ace24b2ac"/><file name="TopMessage.php" hash="80036003eeab72028e67c8c07f4aa52d"/><dir name="View"><file name="Form.php" hash="b6b2afd79c9451697ce3ecba991608fa"/><file name="MailBody.php" hash="44abae1440de697501bd9569b1db73b3"/></dir><file name="View.php" hash="e3f941aad29a565e8f7916e237b30c0a"/></dir><file name="SentEmail.php" hash="578c135cc0f4b9bc3ccc01e745e3df2e"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="AlekseonLogo.php" hash="f51973c6b6547da6d3c4662a7fbb6566"/><file name="AlekseonNotification.php" hash="51f024aaf7825e876064ed8c2736c0bb"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f6539af5c617bc24c000d5d22e9ede3f"/></dir><dir name="Model"><dir name="AlekseonAdminNotification"><file name="Feed.php" hash="27c8bdb9455979eddfd9b91b467425aa"/><file name="Observer.php" hash="f44011324cad1c5284d0ea68a6267020"/></dir><dir name="Email"><file name="Template.php" hash="d872ed3a776d6241626401507359a160"/></dir><file name="Observer.php" hash="cb32eb694fba1e53c2396c0b4398ebf0"/><dir name="Resource"><dir name="SentEmail"><file name="Collection.php" hash="bf1c29041caa2d4614e7894297b55b47"/><dir name="Correspondent"><file name="Collection.php" hash="c4df13aea0717ba228f2b206d71cdc0a"/></dir><file name="Correspondent.php" hash="e4304608fedd99d74e3720ba40ab5811"/></dir><file name="SentEmail.php" hash="3b4302ca7d3c9c9c416dc6d1559847fd"/></dir><dir name="SentEmail"><file name="Correspondent.php" hash="79ce35e0cc043ef088cad17afe87e5b1"/></dir><file name="SentEmail.php" hash="bf53e13806cafd1371f03b78ff8746a0"/><dir name="System"><dir name="Config"><dir name="Source"><file name="AllTemplates.php" hash="32458dd1cc2bd26d84f0c7125c1950ab"/><file name="EncryptionProtocols.php" hash="a099d4bece5da8edc2a8534130ad0fac"/><file name="MailTransportTypes.php" hash="0fbf18aad5a6563f59d399d7c2d004c1"/><file name="SmtpAuthModes.php" hash="459adb6fdc8c456693a29190742f03f4"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="MailTransport"><file name="SentEmailsHistoryController.php" hash="8857976b524cff7451f3fdeeae013932"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="0a84d9392de6dd9ab91fc7cc6b35cc0e"/><file name="config.xml" hash="6ba61815d71dbafe64b491797a8b96d4"/><file name="system.xml" hash="26f65502872705a3f6b61a5046ef25e7"/></dir><dir name="sql"><dir name="alekseon_mailtransport_setup"><file name="mysql4-install-0.1.1.php" hash="e9eab66079a531256d2db8a0895d5d2d"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="3d9654bef73b355ebe8d3b47e72555ff"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="161f973ead0e483088f701e57bc09082"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Alekseon_MailTransport.xml" hash="e99dcf95b0657403cec683729a620450"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="alekseon"><file name="mailTransport.xml" hash="052b7956a3fb7910f5dd29829fc112c7"/></dir></dir><dir name="template"><dir name="alekseon"><dir name="mailTransport"><dir name="sentEmail"><file name="topMessage.phtml" hash="a9440740f61ea7767406108f9011c07c"/><dir name="view"><file name="form.phtml" hash="347e8d8660213209e0b1df26367199b8"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>