mail_transport - Version 0.1.1.5

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.5
Comparing to
See all releases


Code changes from version 0.1.1.4 to 0.1.1.5

app/code/community/Alekseon/MailTransport/Block/Adminhtml/SentEmail/View/Form.php CHANGED
@@ -139,4 +139,9 @@ class Alekseon_MailTransport_Block_Adminhtml_SentEmail_View_Form extends Mage_Ad
139
  {
140
  return $this->getEmail()->getIsConfidential();
141
  }
 
 
 
 
 
142
  }
139
  {
140
  return $this->getEmail()->getIsConfidential();
141
  }
142
+
143
+ public function getController()
144
+ {
145
+ return $this->getEmail()->getController();
146
+ }
147
  }
app/code/community/Alekseon/MailTransport/Model/Email/Template.php CHANGED
@@ -118,20 +118,19 @@ class Alekseon_MailTransport_Model_Email_Template extends Mage_Core_Model_Email_
118
  return $transport;
119
  }
120
 
121
- public function sendTransactional($templateId, $sender, $email, $name, $vars=array(), $storeId=null)
122
- {
123
- $this->getSentEmailModel()->setTemplateId($templateId);
124
- $this->getSentEmailModel()->addSender($sender, $storeId);
125
- return parent::sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
126
- }
127
-
128
  public function send($email, $name = null, array $variables = array())
129
  {
 
 
 
130
  if (isset($variables['store'])) {
131
  $store = $variables['store'];
132
- $this->getMail($store->getId());
133
- $this->getSentEmailModel()->setStoreId($store->getId());
134
  }
 
 
 
135
 
136
  try {
137
  $result = parent::send($email, $name, $variables);
118
  return $transport;
119
  }
120
 
 
 
 
 
 
 
 
121
  public function send($email, $name = null, array $variables = array())
122
  {
123
+ $this->getSentEmailModel()->addSender($this->getSenderEmail(), $this->getSenderName());
124
+ $this->getSentEmailModel()->setTemplateId($this->getId());
125
+
126
  if (isset($variables['store'])) {
127
  $store = $variables['store'];
128
+ } else {
129
+ $store = Mage::app()->getStore();
130
  }
131
+
132
+ $this->getMail($store->getId());
133
+ $this->getSentEmailModel()->setStoreId($store->getId());
134
 
135
  try {
136
  $result = parent::send($email, $name, $variables);
app/code/community/Alekseon/MailTransport/Model/SentEmail.php CHANGED
@@ -1 +1 @@
1
- <?php
2
  * @author Marcin Frymark
3
  * @email contact@alekseon.com
4
  * @company Alekseon
5
  * @website www.alekseon.com
6
  */
7
  protected $_correspondents;
8
  public function __construct($args = array())
9
  {
10
  }
11
 
12
  public function unsetData($key = null)
13
  {
14
  $this->_correspondents = null;
15
  return parent::unsetData($key);
16
  }
17
  public function addReceipient($email, $name = null)
18
  {
19
  return $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_RECEIPIENT, $email, $name);
20
  }
21
 
22
  public function addBccReceipient($email, $name = null)
23
  {
24
  return $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_BCC, $email, $name);
25
  }
26
 
27
  public function addSender($sender, $storeId)
28
  {
29
  if (!is_array($sender)) {
30
  $name = Mage::getStoreConfig('trans_email/ident_' . $sender . '/name', $storeId);
31
  $email = Mage::getStoreConfig('trans_email/ident_' . $sender . '/email', $storeId);
32
  } else {
33
  $name = $sender['name'];
34
  $email = $sender['email'];
35
  }
36
  return $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_SENDER, $email, $name);
37
  }
38
 
39
  public function getCorrespondents()
40
  {
41
  if (is_null($this->_correspondents)) {
42
  $this->_correspondents = Mage::getModel('alekseon_mailTransport/sentEmail_correspondent')
43
  ->getCollection()
44
  ->addFieldToFilter('sentemail_id', $this->getId());
45
  }
46
 
47
  return $this->_correspondents;
48
  }
49
 
50
  protected function _afterSave()
51
  {
52
  if (null !== $this->getCorrespondents()) {
53
  foreach($this->getCorrespondents() as $correspondent) {
54
  if (!$correspondent->getId()) {
55
  $correspondent->setSentemailId($this->getId());
56
  $correspondent->save();
57
  }
58
  }
59
  }
60
  return parent::_afterSave();
61
  }
62
 
63
  protected function _addCorrespondent($type, $email, $name = null)
64
  {
65
  if (is_null($name)) {
66
  $name = substr($email, 0, strpos($email, '@'));
67
  }
68
  $correspondent = Mage::getModel('alekseon_mailTransport/sentEmail_correspondent');
69
  $correspondent->setType($type);
70
  $correspondent->setName($name);
71
  $correspondent->setEmail($email);
72
  $this->getCorrespondents()->addItem($correspondent);
73
  return $correspondent;
74
  }
 
75
  * @author Marcin Frymark
76
  * @email contact@alekseon.com
77
  * @company Alekseon
78
  * @website www.alekseon.com
79
  */
80
  protected $_correspondents;
81
  public function __construct($args = array())
82
  {
83
  }
84
 
85
  public function unsetData($key = null)
86
  {
87
  $this->_correspondents = null;
88
  return parent::unsetData($key);
89
  }
90
  public function addReceipient($email, $name = null)
91
  {
92
  if (!is_array($email)) {
93
  $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_RECEIPIENT, $email, $name);
94
  } else {
95
  foreach ($email as $recipientName => $recipientEmail) {
96
  $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_RECEIPIENT, $recipientEmail, is_int($recipientName) ? '' : $recipientName);
97
  }
98
  }
99
 
100
  return $this;
101
  }
102
 
103
  public function addBccReceipient($email, $name = null)
104
  {
105
  $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_BCC, $email, $name);
106
  return $this;
107
  }
108
 
109
  public function addSender($email, $name = null)
110
  {
111
  $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_SENDER, $email, $name);
112
  return $this;
113
  }
114
 
115
  public function getCorrespondents()
116
  {
117
  if (is_null($this->_correspondents)) {
118
  $this->_correspondents = Mage::getModel('alekseon_mailTransport/sentEmail_correspondent')
119
  ->getCollection()
120
  ->addFieldToFilter('sentemail_id', $this->getId());
121
  }
122
 
123
  return $this->_correspondents;
124
  }
125
 
126
  protected function _beforeSave()
127
  {
128
  $controller = Mage::app()->getFrontController()->getAction();
129
  if (is_object($controller)) {
130
  $this->setController(get_class($controller));
131
  }
132
  return parent::_beforeSave();
133
  }
134
 
135
  protected function _afterSave()
136
  {
137
  if (null !== $this->getCorrespondents()) {
138
  foreach($this->getCorrespondents() as $correspondent) {
139
  if (!$correspondent->getId()) {
140
  $correspondent->setSentemailId($this->getId());
141
  $correspondent->save();
142
  }
143
  }
144
  }
145
  return parent::_afterSave();
146
  }
147
 
148
  protected function _addCorrespondent($type, $email, $name = null)
149
  {
150
  if (is_null($name)) {
151
  $name = substr($email, 0, strpos($email, '@'));
152
  }
153
  $correspondent = Mage::getModel('alekseon_mailTransport/sentEmail_correspondent');
154
  $correspondent->setType($type);
155
  $correspondent->setName($name);
156
  $correspondent->setEmail($email);
157
  $this->getCorrespondents()->addItem($correspondent);
158
  return $this;
159
  }
 
1
  * @author Marcin Frymark
2
  * @email contact@alekseon.com
3
  * @company Alekseon
4
  * @website www.alekseon.com
5
  */
6
  protected $_correspondents;
7
  public function __construct($args = array())
8
  {
9
  }
10
 
11
  public function unsetData($key = null)
12
  {
13
  $this->_correspondents = null;
14
  return parent::unsetData($key);
15
  }
16
  public function addReceipient($email, $name = null)
17
  {
18
  return $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_RECEIPIENT, $email, $name);
19
  }
20
 
21
  public function addBccReceipient($email, $name = null)
22
  {
23
  return $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_BCC, $email, $name);
24
  }
25
 
26
  public function addSender($sender, $storeId)
27
  {
28
  if (!is_array($sender)) {
29
  $name = Mage::getStoreConfig('trans_email/ident_' . $sender . '/name', $storeId);
30
  $email = Mage::getStoreConfig('trans_email/ident_' . $sender . '/email', $storeId);
31
  } else {
32
  $name = $sender['name'];
33
  $email = $sender['email'];
34
  }
35
  return $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_SENDER, $email, $name);
36
  }
37
 
38
  public function getCorrespondents()
39
  {
40
  if (is_null($this->_correspondents)) {
41
  $this->_correspondents = Mage::getModel('alekseon_mailTransport/sentEmail_correspondent')
42
  ->getCollection()
43
  ->addFieldToFilter('sentemail_id', $this->getId());
44
  }
45
 
46
  return $this->_correspondents;
47
  }
48
 
49
  protected function _afterSave()
50
  {
51
  if (null !== $this->getCorrespondents()) {
52
  foreach($this->getCorrespondents() as $correspondent) {
53
  if (!$correspondent->getId()) {
54
  $correspondent->setSentemailId($this->getId());
55
  $correspondent->save();
56
  }
57
  }
58
  }
59
  return parent::_afterSave();
60
  }
61
 
62
  protected function _addCorrespondent($type, $email, $name = null)
63
  {
64
  if (is_null($name)) {
65
  $name = substr($email, 0, strpos($email, '@'));
66
  }
67
  $correspondent = Mage::getModel('alekseon_mailTransport/sentEmail_correspondent');
68
  $correspondent->setType($type);
69
  $correspondent->setName($name);
70
  $correspondent->setEmail($email);
71
  $this->getCorrespondents()->addItem($correspondent);
72
  return $correspondent;
73
  }
74
+ <?php
75
  * @author Marcin Frymark
76
  * @email contact@alekseon.com
77
  * @company Alekseon
78
  * @website www.alekseon.com
79
  */
80
  protected $_correspondents;
81
  public function __construct($args = array())
82
  {
83
  }
84
 
85
  public function unsetData($key = null)
86
  {
87
  $this->_correspondents = null;
88
  return parent::unsetData($key);
89
  }
90
  public function addReceipient($email, $name = null)
91
  {
92
  if (!is_array($email)) {
93
  $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_RECEIPIENT, $email, $name);
94
  } else {
95
  foreach ($email as $recipientName => $recipientEmail) {
96
  $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_RECEIPIENT, $recipientEmail, is_int($recipientName) ? '' : $recipientName);
97
  }
98
  }
99
 
100
  return $this;
101
  }
102
 
103
  public function addBccReceipient($email, $name = null)
104
  {
105
  $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_BCC, $email, $name);
106
  return $this;
107
  }
108
 
109
  public function addSender($email, $name = null)
110
  {
111
  $this->_addCorrespondent(Alekseon_MailTransport_Model_SentEmail_Correspondent::TYPE_SENDER, $email, $name);
112
  return $this;
113
  }
114
 
115
  public function getCorrespondents()
116
  {
117
  if (is_null($this->_correspondents)) {
118
  $this->_correspondents = Mage::getModel('alekseon_mailTransport/sentEmail_correspondent')
119
  ->getCollection()
120
  ->addFieldToFilter('sentemail_id', $this->getId());
121
  }
122
 
123
  return $this->_correspondents;
124
  }
125
 
126
  protected function _beforeSave()
127
  {
128
  $controller = Mage::app()->getFrontController()->getAction();
129
  if (is_object($controller)) {
130
  $this->setController(get_class($controller));
131
  }
132
  return parent::_beforeSave();
133
  }
134
 
135
  protected function _afterSave()
136
  {
137
  if (null !== $this->getCorrespondents()) {
138
  foreach($this->getCorrespondents() as $correspondent) {
139
  if (!$correspondent->getId()) {
140
  $correspondent->setSentemailId($this->getId());
141
  $correspondent->save();
142
  }
143
  }
144
  }
145
  return parent::_afterSave();
146
  }
147
 
148
  protected function _addCorrespondent($type, $email, $name = null)
149
  {
150
  if (is_null($name)) {
151
  $name = substr($email, 0, strpos($email, '@'));
152
  }
153
  $correspondent = Mage::getModel('alekseon_mailTransport/sentEmail_correspondent');
154
  $correspondent->setType($type);
155
  $correspondent->setName($name);
156
  $correspondent->setEmail($email);
157
  $this->getCorrespondents()->addItem($correspondent);
158
  return $this;
159
  }
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.3</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>0 0 * * *</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
  <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>
111
  </sent_email_history>
112
  </alekseon_mailTransport>
113
  </default>
 
114
  * @author Marcin Frymark
115
  * @email contact@alekseon.com
116
  * @company Alekseon
117
  * @website www.alekseon.com
118
  */
119
- ->
120
  <modules>
121
  <Alekseon_MailTransport>
122
  <version>0.1.4</version>
123
  </Alekseon_MailTransport>
124
  </modules>
125
  <global>
126
  <models>
127
  <alekseon_mailTransport>
128
  <class>Alekseon_MailTransport_Model</class>
129
  <resourceModel>alekseon_mailtransport_resource</resourceModel>
130
  </alekseon_mailTransport>
131
  <alekseon_mailtransport_resource>
132
  <class>Alekseon_MailTransport_Model_Resource</class>
133
  <sentemail>
134
  <table>alekseon_mailtransport_sentemail</table>
135
  </sentemail>
136
  <sentemail_correspondent>
137
  <table>alekseon_mailtransport_sentemail_correspondent</table>
138
  </sentemail_correspondent>
139
  </entities>
140
  </alekseon_mailtransport_resource>
141
  <core>
142
  <rewrite>
143
  <email_template>Alekseon_MailTransport_Model_Email_Template</email_template>
144
  </rewrite>
145
  </core>
146
  </models>
147
  <blocks>
148
  <alekseon_mailTransport>
149
  <class>Alekseon_MailTransport_Block</class>
150
  </alekseon_mailTransport>
151
  </blocks>
152
  <helpers>
153
  <alekseon_mailTransport>
154
  <class>Alekseon_MailTransport_Helper</class>
155
  </alekseon_mailTransport>
156
  </helpers>
157
  <resources>
158
  <alekseon_mailtransport_setup>
159
  <setup>
160
  <module>Alekseon_MailTransport</module>
161
  <class>Mage_Core_Model_Resource_Setup</class>
162
  </setup>
163
  </alekseon_mailtransport_setup>
164
  </resources>
165
  </global>
166
  <adminhtml>
167
  <layout>
168
  <updates>
169
  <alekseon_mailTransport>
170
  <file>alekseon/mailTransport.xml</file>
171
  </alekseon_mailTransport>
172
  </updates>
173
  </layout>
174
  <events>
175
  <controller_action_predispatch>
176
  <observers>
177
  <alekseon_adminNotification>
178
  <class>alekseon_mailTransport/alekseonAdminNotification_observer</class>
179
  <method>preDispatch</method>
180
  </alekseon_adminNotification>
181
  </observers>
182
  </controller_action_predispatch>
183
  </events>
184
  </adminhtml>
185
  <admin>
186
  <routers>
187
  <adminhtml>
188
  <args>
189
  <modules>
190
  <alekseon_mailTransport before="Mage_Adminhtml">Alekseon_MailTransport_Adminhtml</alekseon_mailTransport>
191
  </modules>
192
  </args>
193
  </adminhtml>
194
  </routers>
195
  </admin>
196
  <crontab>
197
  <jobs>
198
  <alekseon_remove_old_sent_emails>
199
  <schedule>
200
  <cron_expr>0 0 * * *</cron_expr>
201
  </schedule>
202
  <run>
203
  <model>alekseon_mailTransport/observer::removeOldSentEmails</model>
204
  </run>
205
  </alekseon_remove_old_sent_emails>
206
  </jobs>
207
  </crontab>
208
  <default>
209
  <alekseon_adminNotification>
210
  <general>
211
  <enabled>1</enabled>
212
  <frequency>12</frequency>
213
  </general>
214
  </alekseon_adminNotification>
215
  <alekseon_mailTransport>
216
  <general>
217
  <smtp_password backend_model="adminhtml/system_config_backend_encrypted"/>
218
  </general>
219
  <sent_email_history>
220
  <remove_successed_after>30</remove_successed_after>
221
  <remove_failed_after>30</remove_failed_after>
222
  <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>
223
  </sent_email_history>
224
  </alekseon_mailTransport>
225
  </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.3</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>0 0 * * *</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
  <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>
109
  </sent_email_history>
110
  </alekseon_mailTransport>
111
  </default>
112
+ <?xml version="1.0"?>
113
  * @author Marcin Frymark
114
  * @email contact@alekseon.com
115
  * @company Alekseon
116
  * @website www.alekseon.com
117
  */
 
118
  <modules>
119
  <Alekseon_MailTransport>
120
  <version>0.1.4</version>
121
  </Alekseon_MailTransport>
122
  </modules>
123
  <global>
124
  <models>
125
  <alekseon_mailTransport>
126
  <class>Alekseon_MailTransport_Model</class>
127
  <resourceModel>alekseon_mailtransport_resource</resourceModel>
128
  </alekseon_mailTransport>
129
  <alekseon_mailtransport_resource>
130
  <class>Alekseon_MailTransport_Model_Resource</class>
131
  <sentemail>
132
  <table>alekseon_mailtransport_sentemail</table>
133
  </sentemail>
134
  <sentemail_correspondent>
135
  <table>alekseon_mailtransport_sentemail_correspondent</table>
136
  </sentemail_correspondent>
137
  </entities>
138
  </alekseon_mailtransport_resource>
139
  <core>
140
  <rewrite>
141
  <email_template>Alekseon_MailTransport_Model_Email_Template</email_template>
142
  </rewrite>
143
  </core>
144
  </models>
145
  <blocks>
146
  <alekseon_mailTransport>
147
  <class>Alekseon_MailTransport_Block</class>
148
  </alekseon_mailTransport>
149
  </blocks>
150
  <helpers>
151
  <alekseon_mailTransport>
152
  <class>Alekseon_MailTransport_Helper</class>
153
  </alekseon_mailTransport>
154
  </helpers>
155
  <resources>
156
  <alekseon_mailtransport_setup>
157
  <setup>
158
  <module>Alekseon_MailTransport</module>
159
  <class>Mage_Core_Model_Resource_Setup</class>
160
  </setup>
161
  </alekseon_mailtransport_setup>
162
  </resources>
163
  </global>
164
  <adminhtml>
165
  <layout>
166
  <updates>
167
  <alekseon_mailTransport>
168
  <file>alekseon/mailTransport.xml</file>
169
  </alekseon_mailTransport>
170
  </updates>
171
  </layout>
172
  <events>
173
  <controller_action_predispatch>
174
  <observers>
175
  <alekseon_adminNotification>
176
  <class>alekseon_mailTransport/alekseonAdminNotification_observer</class>
177
  <method>preDispatch</method>
178
  </alekseon_adminNotification>
179
  </observers>
180
  </controller_action_predispatch>
181
  </events>
182
  </adminhtml>
183
  <admin>
184
  <routers>
185
  <adminhtml>
186
  <args>
187
  <modules>
188
  <alekseon_mailTransport before="Mage_Adminhtml">Alekseon_MailTransport_Adminhtml</alekseon_mailTransport>
189
  </modules>
190
  </args>
191
  </adminhtml>
192
  </routers>
193
  </admin>
194
  <crontab>
195
  <jobs>
196
  <alekseon_remove_old_sent_emails>
197
  <schedule>
198
  <cron_expr>0 0 * * *</cron_expr>
199
  </schedule>
200
  <run>
201
  <model>alekseon_mailTransport/observer::removeOldSentEmails</model>
202
  </run>
203
  </alekseon_remove_old_sent_emails>
204
  </jobs>
205
  </crontab>
206
  <default>
207
  <alekseon_adminNotification>
208
  <general>
209
  <enabled>1</enabled>
210
  <frequency>12</frequency>
211
  </general>
212
  </alekseon_adminNotification>
213
  <alekseon_mailTransport>
214
  <general>
215
  <smtp_password backend_model="adminhtml/system_config_backend_encrypted"/>
216
  </general>
217
  <sent_email_history>
218
  <remove_successed_after>30</remove_successed_after>
219
  <remove_failed_after>30</remove_failed_after>
220
  <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>
221
  </sent_email_history>
222
  </alekseon_mailTransport>
223
  </default>
app/code/community/Alekseon/MailTransport/sql/alekseon_mailtransport_setup/mysql4-upgrade-0.1.3-0.1.4.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 `controller` varchar(255) NOT NULL default '';
12
+ ");
13
+ $installer->endSetup();
app/design/adminhtml/default/default/template/alekseon/mailTransport/sentEmail/view/form.phtml CHANGED
@@ -25,6 +25,12 @@
25
  <td class="label"><label><?php echo Mage::helper('alekseon_mailTransport')->__('Sent From') ?></label></td>
26
  <td class="value"><strong><?php echo $this->getSentFrom() ?></strong></td>
27
  </tr>
 
 
 
 
 
 
28
  <tr>
29
  <td class="label"><label><?php echo Mage::helper('alekseon_mailTransport')->__('Status') ?></label></td>
30
  <?php if ($this->getStatus()): ?>
25
  <td class="label"><label><?php echo Mage::helper('alekseon_mailTransport')->__('Sent From') ?></label></td>
26
  <td class="value"><strong><?php echo $this->getSentFrom() ?></strong></td>
27
  </tr>
28
+ <?php if ($this->getController()): ?>
29
+ <tr>
30
+ <td class="label"><label><?php echo Mage::helper('alekseon_mailTransport')->__('Controller') ?></label></td>
31
+ <td class="value"><strong><?php echo $this->getController() ?></strong></td>
32
+ </tr>
33
+ <?php endif ?>
34
  <tr>
35
  <td class="label"><label><?php echo Mage::helper('alekseon_mailTransport')->__('Status') ?></label></td>
36
  <?php if ($this->getStatus()): ?>
package.xml CHANGED
@@ -1,7 +1,7 @@
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,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-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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>mail_transport</name>
4
+ <version>0.1.1.5</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-07-02</date>
14
+ <time>19:46:06</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="4e9aaf1663c7763550b68894eb54a0b0"/><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="d55ad5ac934cb002ab7b86155511093b"/></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="ed67caf05d5f4e804fc24461ff415823"/><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="72f211485e0e60895cc79b624ec4e6f3"/><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"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="aba0dd9636b0fea181d3ec160121de9b"/></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="c3f897163e1636fffee14988d8aae62a"/></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>