Version Notes
Release 0.1.2
Download this release
Release Info
Developer | Magento Core Team |
Extension | Sinabs_AutomaticResponse |
Version | 0.1.2 |
Comparing to | |
See all releases |
Version 0.1.2
- app/code/community/Sinabs/AutomaticResponse/Block/Adminhtml/Mail.php +30 -0
- app/code/community/Sinabs/AutomaticResponse/Block/Adminhtml/Mail/Grid.php +91 -0
- app/code/community/Sinabs/AutomaticResponse/Block/Adminhtml/Mail/View.php +56 -0
- app/code/community/Sinabs/AutomaticResponse/Block/Adminhtml/Mail/View/Form.php +32 -0
- app/code/community/Sinabs/AutomaticResponse/Helper/Data.php +23 -0
- app/code/community/Sinabs/AutomaticResponse/Model/Mail.php +27 -0
- app/code/community/Sinabs/AutomaticResponse/Model/Mysql4/Mail.php +26 -0
- app/code/community/Sinabs/AutomaticResponse/Model/Mysql4/Mail/Collection.php +27 -0
- app/code/community/Sinabs/AutomaticResponse/Model/Observer.php +92 -0
- app/code/community/Sinabs/AutomaticResponse/controllers/Adminhtml/MailController.php +97 -0
- app/code/community/Sinabs/AutomaticResponse/etc/config.xml +159 -0
- app/code/community/Sinabs/AutomaticResponse/etc/system.xml +92 -0
- app/code/community/Sinabs/AutomaticResponse/sql/automaticresponse_setup/mysql4-install-0.1.0.php +36 -0
- app/code/community/Sinabs/AutomaticResponse/sql/automaticresponse_setup/mysql4-upgrade-0.1.0-0.0.1.php +24 -0
- app/code/community/Sinabs/AutomaticResponse/sql/automaticresponse_setup/mysql4-upgrade-0.1.1-0.1.2.php +25 -0
- app/design/adminhtml/default/default/template/sinabs/automaticresponse/mail/view.phtml +50 -0
- app/etc/modules/Sinabs_AutomaticResponse.xml +13 -0
- app/locale/en_US/template/email/automatic_response.html +32 -0
- app/locale/fr_FR/Sinabs_AutomaticResponse.csv +7 -0
- app/locale/fr_FR/template/email/automatic_response.html +32 -0
- package.xml +18 -0
app/code/community/Sinabs/AutomaticResponse/Block/Adminhtml/Mail.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_AutomaticResponse_Block_Adminhtml_Mail extends Mage_Adminhtml_Block_Widget_Grid_Container
|
21 |
+
{
|
22 |
+
public function __construct()
|
23 |
+
{
|
24 |
+
$this->_controller = 'adminhtml_mail';
|
25 |
+
$this->_blockGroup = 'automaticresponse';
|
26 |
+
$this->_headerText = Mage::helper('automaticresponse')->__('Emails saved');
|
27 |
+
parent::__construct();
|
28 |
+
$this->_removeButton('add');
|
29 |
+
}
|
30 |
+
}
|
app/code/community/Sinabs/AutomaticResponse/Block/Adminhtml/Mail/Grid.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_AutomaticResponse_Block_Adminhtml_Mail_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
21 |
+
{
|
22 |
+
public function __construct()
|
23 |
+
{
|
24 |
+
parent::__construct();
|
25 |
+
$this->setId('mailGrid');
|
26 |
+
$this->setDefaultSort('mail_id');
|
27 |
+
$this->setDefaultDir('DESC');
|
28 |
+
$this->setSaveParametersInSession(true);
|
29 |
+
}
|
30 |
+
|
31 |
+
protected function _prepareCollection()
|
32 |
+
{
|
33 |
+
$collection = Mage::getModel('automaticresponse/mail')->getCollection();
|
34 |
+
$this->setCollection($collection);
|
35 |
+
return parent::_prepareCollection();
|
36 |
+
}
|
37 |
+
|
38 |
+
protected function _prepareColumns()
|
39 |
+
{
|
40 |
+
$this->addColumn('mail_id', array(
|
41 |
+
'header' => Mage::helper('automaticresponse')->__('ID'),
|
42 |
+
'width' => '50px',
|
43 |
+
'type' => 'number',
|
44 |
+
'index' => 'mail_id'
|
45 |
+
));
|
46 |
+
|
47 |
+
$this->addColumn('created_at', array(
|
48 |
+
'header' => Mage::helper('automaticresponse')->__('Date'),
|
49 |
+
'type' => 'date',
|
50 |
+
'align' => 'left',
|
51 |
+
'index' => 'created_at'
|
52 |
+
));
|
53 |
+
|
54 |
+
$this->addColumn('name', array(
|
55 |
+
'header' => Mage::helper('automaticresponse')->__('Name'),
|
56 |
+
'align' => 'left',
|
57 |
+
'index' => 'name'
|
58 |
+
));
|
59 |
+
|
60 |
+
$this->addColumn('email', array(
|
61 |
+
'header' => Mage::helper('automaticresponse')->__('Email'),
|
62 |
+
'align' => 'left',
|
63 |
+
'index' => 'email'
|
64 |
+
));
|
65 |
+
|
66 |
+
$this->addColumn('phone', array(
|
67 |
+
'header' => Mage::helper('automaticresponse')->__('Phone'),
|
68 |
+
'align' => 'left',
|
69 |
+
'index' => 'phone'
|
70 |
+
));
|
71 |
+
|
72 |
+
return parent::_prepareColumns();
|
73 |
+
}
|
74 |
+
|
75 |
+
protected function _prepareMassaction()
|
76 |
+
{
|
77 |
+
$this->setMassactionIdField('mail_id');
|
78 |
+
$this->getMassactionBlock()->setFormFieldName('mail');
|
79 |
+
|
80 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
81 |
+
'label' => $this->__('Delete'),
|
82 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
83 |
+
'confirm' => $this->__('Are you sure?')
|
84 |
+
));
|
85 |
+
}
|
86 |
+
|
87 |
+
public function getRowUrl($row)
|
88 |
+
{
|
89 |
+
return $this->getUrl('*/*/view', array('mail' => $row->getId()));
|
90 |
+
}
|
91 |
+
}
|
app/code/community/Sinabs/AutomaticResponse/Block/Adminhtml/Mail/View.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_AutomaticResponse_Block_Adminhtml_Mail_View extends Mage_Adminhtml_Block_Widget_Form_Container
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Initialize view container
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
public function __construct()
|
27 |
+
{
|
28 |
+
$this->_objectId = 'mail';
|
29 |
+
$this->_controller = 'adminhtml_mail';
|
30 |
+
$this->_mode = 'view';
|
31 |
+
$this->_blockGroup = 'automaticresponse';
|
32 |
+
|
33 |
+
parent::__construct();
|
34 |
+
|
35 |
+
$this->_removeButton('reset');
|
36 |
+
$this->_removeButton('save');
|
37 |
+
|
38 |
+
$this->setId('automaticresponse_mail_view');
|
39 |
+
|
40 |
+
$this->_addButton('back', array(
|
41 |
+
'label' => Mage::helper('adminhtml')->__('Back'),
|
42 |
+
'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')',
|
43 |
+
'class' => 'back',
|
44 |
+
), -1);
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Retrieve header text
|
49 |
+
*
|
50 |
+
* @return string
|
51 |
+
*/
|
52 |
+
public function getHeaderText()
|
53 |
+
{
|
54 |
+
return Mage::helper('automaticresponse')->__('Email #%s', Mage::registry('current_mail')->getId());
|
55 |
+
}
|
56 |
+
}
|
app/code/community/Sinabs/AutomaticResponse/Block/Adminhtml/Mail/View/Form.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_AutomaticResponse_Block_Adminhtml_Mail_View_Form extends Mage_Adminhtml_Block_Template
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Define custom template
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
protected function _construct()
|
27 |
+
{
|
28 |
+
parent::_construct();
|
29 |
+
$this->setData('mail', Mage::registry('current_mail'));
|
30 |
+
$this->setTemplate('sinabs/automaticresponse/mail/view.phtml');
|
31 |
+
}
|
32 |
+
}
|
app/code/community/Sinabs/AutomaticResponse/Helper/Data.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_AutomaticResponse_Helper_Data extends Mage_Core_Helper_Abstract
|
21 |
+
{
|
22 |
+
|
23 |
+
}
|
app/code/community/Sinabs/AutomaticResponse/Model/Mail.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_AutomaticResponse_Model_Mail extends Mage_Core_Model_Abstract
|
21 |
+
{
|
22 |
+
public function _construct()
|
23 |
+
{
|
24 |
+
parent::_construct();
|
25 |
+
$this->_init('automaticresponse/mail');
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Sinabs/AutomaticResponse/Model/Mysql4/Mail.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_AutomaticResponse_Model_Mysql4_Mail extends Mage_Core_Model_Mysql4_Abstract
|
21 |
+
{
|
22 |
+
public function _construct()
|
23 |
+
{
|
24 |
+
$this->_init('automaticresponse/mail', 'mail_id');
|
25 |
+
}
|
26 |
+
}
|
app/code/community/Sinabs/AutomaticResponse/Model/Mysql4/Mail/Collection.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_AutomaticResponse_Model_Mysql4_Mail_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
21 |
+
{
|
22 |
+
public function _construct()
|
23 |
+
{
|
24 |
+
parent::_construct();
|
25 |
+
$this->_init('automaticresponse/mail');
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Sinabs/AutomaticResponse/Model/Observer.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_AutomaticResponse_Model_Observer
|
21 |
+
{
|
22 |
+
const XML_PATH_AUTOMATICRESPONSE_GENERAL_ENABLED = 'automaticresponse/general/active';
|
23 |
+
const XML_PATH_AUTOMATICRESPONSE_GENERAL_TEMPLATE = 'automaticresponse/general/template';
|
24 |
+
const XML_PATH_CONTACTS_RECIPIENT_EMAIL = 'contacts/email/recipient_email';
|
25 |
+
const XML_PATH_AUTOMATICRESPONSE_GENERAL_SENDER = 'automaticresponse/general/sender_email_identity';
|
26 |
+
const XML_PATH_AUTOMATICRESPONSE_BACKUP_ACTIVE = 'automaticresponse/backup/active';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Send automatic response
|
30 |
+
*
|
31 |
+
* @param Varien_Event_Observer $observer
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
public function sendAutomaticResponse(Varien_Event_Observer $observer)
|
35 |
+
{
|
36 |
+
if (!Mage::getStoreConfig(self::XML_PATH_AUTOMATICRESPONSE_GENERAL_ENABLED)) {
|
37 |
+
return;
|
38 |
+
}
|
39 |
+
|
40 |
+
$controllerAction = $observer->getControllerAction();
|
41 |
+
$storeId = Mage::app()->getStore()->getId();
|
42 |
+
|
43 |
+
$translate = Mage::getSingleton('core/translate');
|
44 |
+
$translate->setTranslateInline(false);
|
45 |
+
|
46 |
+
try {
|
47 |
+
$mailTemplate = Mage::getModel('core/email_template');
|
48 |
+
$mailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $storeId));
|
49 |
+
$mailTemplate->setReplyTo(Mage::getStoreConfig(self::XML_PATH_CONTACTS_RECIPIENT_EMAIL, $storeId));
|
50 |
+
$mailTemplate->sendTransactional(
|
51 |
+
Mage::getStoreConfig(self::XML_PATH_AUTOMATICRESPONSE_GENERAL_TEMPLATE, $storeId),
|
52 |
+
Mage::getStoreConfig(self::XML_PATH_AUTOMATICRESPONSE_GENERAL_SENDER),
|
53 |
+
$controllerAction->getRequest()->getParam('email'),
|
54 |
+
null,
|
55 |
+
array(),
|
56 |
+
$storeId
|
57 |
+
);
|
58 |
+
} catch (Exception $e) {
|
59 |
+
Mage::logException($e);
|
60 |
+
return false;
|
61 |
+
}
|
62 |
+
|
63 |
+
$translate->setTranslateInline(true);
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Save Contacts email in DB
|
68 |
+
*
|
69 |
+
* @param Varien_Event_Observer $observer
|
70 |
+
*/
|
71 |
+
public function saveEmail(Varien_Event_Observer $observer)
|
72 |
+
{
|
73 |
+
if (!Mage::getStoreConfig(self::XML_PATH_AUTOMATICRESPONSE_BACKUP_ACTIVE)) {
|
74 |
+
return;
|
75 |
+
}
|
76 |
+
|
77 |
+
$request = $observer->getControllerAction()->getRequest();
|
78 |
+
$model = Mage::getModel('automaticresponse/mail');
|
79 |
+
|
80 |
+
$model->setCreatedAt(now());
|
81 |
+
$model->setName($request->getParam('name'));
|
82 |
+
$model->setEmail($request->getParam('email'));
|
83 |
+
$model->setPhone($request->getParam('telephone'));
|
84 |
+
$model->setComment($request->getParam('comment'));
|
85 |
+
|
86 |
+
try {
|
87 |
+
$model->save();
|
88 |
+
} catch (Exception $e) {
|
89 |
+
Mage::logException($e->getMessage());
|
90 |
+
}
|
91 |
+
}
|
92 |
+
}
|
app/code/community/Sinabs/AutomaticResponse/controllers/Adminhtml/MailController.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_AutomaticResponse_Adminhtml_MailController extends Mage_Adminhtml_Controller_Action
|
21 |
+
{
|
22 |
+
public function _initAction()
|
23 |
+
{
|
24 |
+
$this->loadLayout()->_setActiveMenu('system');
|
25 |
+
return $this;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function indexAction()
|
29 |
+
{
|
30 |
+
$this->_forward('list');
|
31 |
+
}
|
32 |
+
|
33 |
+
public function listAction()
|
34 |
+
{
|
35 |
+
$this->_initAction()->_addContent($this->getLayout()->createBlock('automaticresponse/adminhtml_mail'));
|
36 |
+
$this->renderLayout();
|
37 |
+
}
|
38 |
+
|
39 |
+
public function viewAction()
|
40 |
+
{
|
41 |
+
if (!$mail = $this->_initMail()) {
|
42 |
+
return;
|
43 |
+
}
|
44 |
+
|
45 |
+
$this->_initAction()->_addContent($this->getLayout()->createBlock('automaticresponse/adminhtml_mail_view'));
|
46 |
+
$this->renderLayout();
|
47 |
+
}
|
48 |
+
|
49 |
+
public function deleteAction()
|
50 |
+
{
|
51 |
+
if($id = $this->getRequest()->getParam('mail')) {
|
52 |
+
try {
|
53 |
+
Mage::getModel('automaticresponse/mail')->load($id)->delete();
|
54 |
+
Mage::getSingleton('adminhtml/session')->addSuccess('The mail has been deleted');
|
55 |
+
$this->_Redirect('*/*/list');
|
56 |
+
return;
|
57 |
+
} catch (Exception $e) {
|
58 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
59 |
+
$this->_redirect('*/*/list');
|
60 |
+
return;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
public function massDeleteAction()
|
66 |
+
{
|
67 |
+
$ids = $this->getRequest()->getParam('mail');
|
68 |
+
if (!is_array($ids)) {
|
69 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select mail(s)'));
|
70 |
+
} else {
|
71 |
+
try {
|
72 |
+
foreach ($ids as $id) {
|
73 |
+
Mage::getModel('automaticresponse/mail')->load($id)->delete();
|
74 |
+
}
|
75 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Total of %d record(s) were successfully deleted', count($ids)));
|
76 |
+
} catch (Exception $e) {
|
77 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
78 |
+
}
|
79 |
+
}
|
80 |
+
$this->_redirect('*/*/index');
|
81 |
+
}
|
82 |
+
|
83 |
+
protected function _initMail()
|
84 |
+
{
|
85 |
+
$mailId = $this->getRequest()->getParam('mail');
|
86 |
+
if ($mailId) {
|
87 |
+
$mail = Mage::getModel('automaticresponse/mail')->load($mailId);
|
88 |
+
if (!$mail->getId()) {
|
89 |
+
$this->_getSession()->addError($this->__('Wrong mail ID specified.'));
|
90 |
+
$this->_redirect('*/*/');
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
Mage::register('current_mail', $mail);
|
95 |
+
return $mail;
|
96 |
+
}
|
97 |
+
}
|
app/code/community/Sinabs/AutomaticResponse/etc/config.xml
ADDED
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Sinabs
|
17 |
+
* @package Sinabs_AutomaticResponse
|
18 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<config>
|
23 |
+
<modules>
|
24 |
+
<Sinabs_AutomaticResponse>
|
25 |
+
<version>0.1.2</version>
|
26 |
+
</Sinabs_AutomaticResponse>
|
27 |
+
</modules>
|
28 |
+
<global>
|
29 |
+
<helpers>
|
30 |
+
<automaticresponse>
|
31 |
+
<class>Sinabs_AutomaticResponse_Helper</class>
|
32 |
+
</automaticresponse>
|
33 |
+
</helpers>
|
34 |
+
<blocks>
|
35 |
+
<automaticresponse>
|
36 |
+
<class>Sinabs_AutomaticResponse_Block</class>
|
37 |
+
</automaticresponse>
|
38 |
+
</blocks>
|
39 |
+
<models>
|
40 |
+
<automaticresponse>
|
41 |
+
<class>Sinabs_AutomaticResponse_Model</class>
|
42 |
+
<resourceModel>automaticresponse_mysql4</resourceModel>
|
43 |
+
</automaticresponse>
|
44 |
+
<automaticresponse_mysql4>
|
45 |
+
<class>Sinabs_AutomaticResponse_Model_Mysql4</class>
|
46 |
+
<entities>
|
47 |
+
<mail>
|
48 |
+
<table>sinabs_automaticresponse_mail</table>
|
49 |
+
</mail>
|
50 |
+
</entities>
|
51 |
+
</automaticresponse_mysql4>
|
52 |
+
</models>
|
53 |
+
<events>
|
54 |
+
<controller_action_postdispatch_contacts_index_post>
|
55 |
+
<observers>
|
56 |
+
<sinabs_automaticresponse_contacts_post_observer_send>
|
57 |
+
<type>singleton</type>
|
58 |
+
<class>Sinabs_AutomaticResponse_Model_Observer</class>
|
59 |
+
<method>sendAutomaticResponse</method>
|
60 |
+
</sinabs_automaticresponse_contacts_post_observer_send>
|
61 |
+
<sinabs_automaticresponse_contacts_post_observer_save>
|
62 |
+
<type>singleton</type>
|
63 |
+
<class>Sinabs_AutomaticResponse_Model_Observer</class>
|
64 |
+
<method>saveEmail</method>
|
65 |
+
</sinabs_automaticresponse_contacts_post_observer_save>
|
66 |
+
</observers>
|
67 |
+
</controller_action_postdispatch_contacts_index_post>
|
68 |
+
</events>
|
69 |
+
<resources>
|
70 |
+
<automaticresponse_setup>
|
71 |
+
<setup>
|
72 |
+
<module>Sinabs_AutomaticResponse</module>
|
73 |
+
</setup>
|
74 |
+
<connection>
|
75 |
+
<use>core_setup</use>
|
76 |
+
</connection>
|
77 |
+
</automaticresponse_setup>
|
78 |
+
</resources>
|
79 |
+
<template>
|
80 |
+
<email>
|
81 |
+
<automaticresponse_general_template translate="label" module="automaticresponse">
|
82 |
+
<label>Automatic Response</label>
|
83 |
+
<file>automatic_response.html</file>
|
84 |
+
<type>html</type>
|
85 |
+
</automaticresponse_general_template>
|
86 |
+
</email>
|
87 |
+
</template>
|
88 |
+
</global>
|
89 |
+
<frontend>
|
90 |
+
<routers>
|
91 |
+
<Sinabs_AutomaticResponse>
|
92 |
+
<use>standard</use>
|
93 |
+
<args>
|
94 |
+
<module>Sinabs_AutomaticResponse</module>
|
95 |
+
<frontName>automaticresponse</frontName>
|
96 |
+
</args>
|
97 |
+
</Sinabs_AutomaticResponse>
|
98 |
+
</routers>
|
99 |
+
</frontend>
|
100 |
+
<admin>
|
101 |
+
<routers>
|
102 |
+
<automaticresponse_admin>
|
103 |
+
<use>admin</use>
|
104 |
+
<args>
|
105 |
+
<module>Sinabs_AutomaticResponse</module>
|
106 |
+
<frontName>automaticresponse_admin</frontName>
|
107 |
+
</args>
|
108 |
+
</automaticresponse_admin>
|
109 |
+
</routers>
|
110 |
+
</admin>
|
111 |
+
<adminhtml>
|
112 |
+
<translate>
|
113 |
+
<modules>
|
114 |
+
<Sinabs_AutomaticResponse>
|
115 |
+
<files>
|
116 |
+
<default>Sinabs_AutomaticResponse.csv</default>
|
117 |
+
</files>
|
118 |
+
</Sinabs_AutomaticResponse>
|
119 |
+
</modules>
|
120 |
+
</translate>
|
121 |
+
<menu>
|
122 |
+
<system>
|
123 |
+
<children>
|
124 |
+
<automaticresponse translate="title" module="adminhtml">
|
125 |
+
<title>Emails saved</title>
|
126 |
+
<action>automaticresponse_admin/adminhtml_mail</action>
|
127 |
+
</automaticresponse>
|
128 |
+
</children>
|
129 |
+
</system>
|
130 |
+
</menu>
|
131 |
+
<acl>
|
132 |
+
<resources>
|
133 |
+
<admin>
|
134 |
+
<children>
|
135 |
+
<system>
|
136 |
+
<children>
|
137 |
+
<config>
|
138 |
+
<children>
|
139 |
+
<automaticresponse translate="title" module="automaticresponse">
|
140 |
+
<title>Section Automatic Response</title>
|
141 |
+
</automaticresponse>
|
142 |
+
</children>
|
143 |
+
</config>
|
144 |
+
</children>
|
145 |
+
</system>
|
146 |
+
</children>
|
147 |
+
</admin>
|
148 |
+
</resources>
|
149 |
+
</acl>
|
150 |
+
</adminhtml>
|
151 |
+
<default>
|
152 |
+
<automaticresponse>
|
153 |
+
<general>
|
154 |
+
<sender_email_identity>general</sender_email_identity>
|
155 |
+
<template>automaticresponse_general_template</template>
|
156 |
+
</general>
|
157 |
+
</automaticresponse>
|
158 |
+
</default>
|
159 |
+
</config>
|
app/code/community/Sinabs/AutomaticResponse/etc/system.xml
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Sinabs
|
17 |
+
* @package Sinabs_AutomaticResponse
|
18 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<config>
|
23 |
+
<sections>
|
24 |
+
<automaticresponse translate="label" module="automaticresponse">
|
25 |
+
<label>Automatic Response</label>
|
26 |
+
<tab>sinabs</tab>
|
27 |
+
<frontend_type>text</frontend_type>
|
28 |
+
<sort_order>101</sort_order>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>1</show_in_store>
|
32 |
+
<groups>
|
33 |
+
<general translate="label">
|
34 |
+
<label>General</label>
|
35 |
+
<frontend_type>text</frontend_type>
|
36 |
+
<sort_order>10</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>1</show_in_store>
|
40 |
+
<fields>
|
41 |
+
<active translate="label">
|
42 |
+
<label>Enabled</label>
|
43 |
+
<frontend_type>select</frontend_type>
|
44 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
45 |
+
<sort_order>10</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
+
</active>
|
50 |
+
<sender_email_identity translate="label">
|
51 |
+
<label>Sender Email</label>
|
52 |
+
<frontend_type>select</frontend_type>
|
53 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
54 |
+
<sort_order>20</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
</sender_email_identity>
|
59 |
+
<template translate="label">
|
60 |
+
<label>Email Template</label>
|
61 |
+
<frontend_type>select</frontend_type>
|
62 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
63 |
+
<sort_order>30</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
+
</template>
|
68 |
+
</fields>
|
69 |
+
</general>
|
70 |
+
<backup translate="label">
|
71 |
+
<label>Backup</label>
|
72 |
+
<frontend_type>text</frontend_type>
|
73 |
+
<sort_order>20</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
<fields>
|
78 |
+
<active translate="label">
|
79 |
+
<label>Enabled</label>
|
80 |
+
<frontend_type>select</frontend_type>
|
81 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
82 |
+
<sort_order>10</sort_order>
|
83 |
+
<show_in_default>1</show_in_default>
|
84 |
+
<show_in_website>1</show_in_website>
|
85 |
+
<show_in_store>1</show_in_store>
|
86 |
+
</active>
|
87 |
+
</fields>
|
88 |
+
</backup>
|
89 |
+
</groups>
|
90 |
+
</automaticresponse>
|
91 |
+
</sections>
|
92 |
+
</config>
|
app/code/community/Sinabs/AutomaticResponse/sql/automaticresponse_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
22 |
+
$installer = $this;
|
23 |
+
$installer->startSetup();
|
24 |
+
|
25 |
+
$installer->run("
|
26 |
+
CREATE TABLE {$this->getTable('sinabs_automaticresponse_mail')} (
|
27 |
+
`mail_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT ,
|
28 |
+
`name` VARCHAR(255) NOT NULL ,
|
29 |
+
`email` VARCHAR(255) NOT NULL ,
|
30 |
+
`phone` VARCHAR(255) NOT NULL ,
|
31 |
+
`comment` TEXT NOT NULL ,
|
32 |
+
PRIMARY KEY (`mail_id`)
|
33 |
+
) ENGINE = INNODB;
|
34 |
+
");
|
35 |
+
|
36 |
+
$installer->endSetup();
|
app/code/community/Sinabs/AutomaticResponse/sql/automaticresponse_setup/mysql4-upgrade-0.1.0-0.0.1.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
22 |
+
$installer = $this;
|
23 |
+
$installer->startSetup();
|
24 |
+
$installer->run("ALTER TABLE {$this->getTable('sinabs_automaticresponse_mail')} ADD `date` DATETIME NOT NULL AFTER `mail_id`");
|
app/code/community/Sinabs/AutomaticResponse/sql/automaticresponse_setup/mysql4-upgrade-0.1.1-0.1.2.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_AutomaticResponse
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
22 |
+
$installer = $this;
|
23 |
+
$installer->startSetup();
|
24 |
+
$installer->run("ALTER TABLE {$this->getTable('sinabs_automaticresponse_mail')} CHANGE `date` `created_at` TIMESTAMP NOT NULL");
|
25 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/template/sinabs/automaticresponse/mail/view.phtml
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category design
|
16 |
+
* @package default_default
|
17 |
+
* @copyright Copyright (c) 2012 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
?>
|
21 |
+
<?php $_mail = $this->getMail(); ?>
|
22 |
+
<div class="entry-edit">
|
23 |
+
<div class="entry-edit-head"><strong><?php echo $this->__('Email #%s', $_mail->getId()); ?></strong></div>
|
24 |
+
<div class="fieldset">
|
25 |
+
<table cellspacing="0" class="form-list">
|
26 |
+
<tbody>
|
27 |
+
<tr>
|
28 |
+
<td class="label"><label><?php echo $this->__('Date'); ?></label></td>
|
29 |
+
<td><strong><?php echo Mage::helper('core')->formatDate($_mail->getDate(), 'medium', false); ?></strong></td>
|
30 |
+
</tr>
|
31 |
+
<tr>
|
32 |
+
<td class="label"><label><?php echo $this->__('Name'); ?></label></td>
|
33 |
+
<td><strong><?php echo $_mail->getName(); ?></strong></td>
|
34 |
+
</tr>
|
35 |
+
<tr>
|
36 |
+
<td class="label"><label><?php echo $this->__('Email'); ?></label></td>
|
37 |
+
<td><strong><?php echo $_mail->getEmail(); ?></strong></td>
|
38 |
+
</tr>
|
39 |
+
<tr>
|
40 |
+
<td class="label"><label><?php echo $this->__('Phone'); ?></label></td>
|
41 |
+
<td><strong><?php echo $_mail->getPhone(); ?></strong></td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<td class="label"><label><?php echo $this->__('Comment'); ?></label></td>
|
45 |
+
<td><strong><?php echo nl2br($_mail->getComment()); ?></strong></td>
|
46 |
+
</tr>
|
47 |
+
</tbody>
|
48 |
+
</table>
|
49 |
+
</div>
|
50 |
+
</div>
|
app/etc/modules/Sinabs_AutomaticResponse.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<Sinabs_AutomaticResponse>
|
6 |
+
<active>true</active>
|
7 |
+
<codePool>community</codePool>
|
8 |
+
<depends>
|
9 |
+
<Sinabs_All />
|
10 |
+
</depends>
|
11 |
+
</Sinabs_AutomaticResponse>
|
12 |
+
</modules>
|
13 |
+
</config>
|
app/locale/en_US/template/email/automatic_response.html
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject Contact Form @-->
|
2 |
+
<div style="font: 11px/ 1.35em Verdana, Arial, Helvetica, sans-serif;">
|
3 |
+
<table cellspacing="0" cellpadding="0" border="0" width="98%"
|
4 |
+
style="margin-top: 10px; font: 11px/ 1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom: 10px;">
|
5 |
+
<tr>
|
6 |
+
<td align="center" valign="top"><!-- [ header starts here] -->
|
7 |
+
<table cellspacing="0" cellpadding="0" border="0" width="650">
|
8 |
+
<tr>
|
9 |
+
<td valign="top">
|
10 |
+
<p><a href="{{store url=""}}" style="color: #1E7EC8;"><img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var store.getFrontendName()}}" border="0" /></a></p>
|
11 |
+
</td>
|
12 |
+
</tr>
|
13 |
+
</table>
|
14 |
+
<table cellspacing="0" cellpadding="0" border="0" width="650">
|
15 |
+
<tr>
|
16 |
+
<td valign="top">
|
17 |
+
<p><strong>Hello,</strong>
|
18 |
+
<p>
|
19 |
+
Thank you for your interest in {{var store.getFrontendName()}}.
|
20 |
+
Your message has been sent to our customer service and will be treated as soon as possible.
|
21 |
+
</p>
|
22 |
+
<p>
|
23 |
+
Regards,<br />
|
24 |
+
<strong>Team {{var store.getFrontendName()}}</strong>
|
25 |
+
</p>
|
26 |
+
</td>
|
27 |
+
</tr>
|
28 |
+
</table>
|
29 |
+
</td>
|
30 |
+
</tr>
|
31 |
+
</table>
|
32 |
+
</div>
|
app/locale/fr_FR/Sinabs_AutomaticResponse.csv
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Emails saved", "Emails sauvegardés"
|
2 |
+
"Phone", "Téléphone"
|
3 |
+
"The mail has been deleted", "Le message a été supprimé"
|
4 |
+
"Please select mail(s)", "Veuillez choisir des messages"
|
5 |
+
"Total of %d record(s) were successfully deleted", "%d enregistrement(s) ont été supprimés avec succès"
|
6 |
+
"Wrong mail ID specified.", "L'ID du message n'existe pas."
|
7 |
+
"Automatic Response", "Réponse automatique"
|
app/locale/fr_FR/template/email/automatic_response.html
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject Formulaire de contact @-->
|
2 |
+
<div style="font: 11px/ 1.35em Verdana, Arial, Helvetica, sans-serif;">
|
3 |
+
<table cellspacing="0" cellpadding="0" border="0" width="98%"
|
4 |
+
style="margin-top: 10px; font: 11px/ 1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom: 10px;">
|
5 |
+
<tr>
|
6 |
+
<td align="center" valign="top"><!-- [ header starts here] -->
|
7 |
+
<table cellspacing="0" cellpadding="0" border="0" width="650">
|
8 |
+
<tr>
|
9 |
+
<td valign="top">
|
10 |
+
<p><a href="{{store url=""}}" style="color: #1E7EC8;"><img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var store.getFrontendName()}}" border="0" /></a></p>
|
11 |
+
</td>
|
12 |
+
</tr>
|
13 |
+
</table>
|
14 |
+
<table cellspacing="0" cellpadding="0" border="0" width="650">
|
15 |
+
<tr>
|
16 |
+
<td valign="top">
|
17 |
+
<p><strong>Bonjour,</strong>
|
18 |
+
<p>
|
19 |
+
Merci de l'intêret que vous portez à {{var store.getFrontendName()}}.
|
20 |
+
Votre message a bien été transmis à notre service client et sera traité dans les meilleurs délais.
|
21 |
+
</p>
|
22 |
+
<p>
|
23 |
+
Cordialement,<br />
|
24 |
+
<strong>L'équipe {{var store.getFrontendName()}}</strong>
|
25 |
+
</p>
|
26 |
+
</td>
|
27 |
+
</tr>
|
28 |
+
</table>
|
29 |
+
</td>
|
30 |
+
</tr>
|
31 |
+
</table>
|
32 |
+
</div>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Sinabs_AutomaticResponse</name>
|
4 |
+
<version>0.1.2</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Automatic response to requests for contact and archiving</summary>
|
10 |
+
<description>The Sinabs module Automatic Response allows you to set an automatic response to any request for contact on your website. The module also enables archiving of all contact requests</description>
|
11 |
+
<notes>Release 0.1.2</notes>
|
12 |
+
<authors><author><name>Sinabs</name><user>auto-converted</user><email>tech@sinabs.fr</email></author></authors>
|
13 |
+
<date>2013-08-29</date>
|
14 |
+
<time>12:43:43</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Sinabs"><dir name="AutomaticResponse"><dir name="Block"><dir name="Adminhtml"><dir name="Mail"><dir name="View"><file name="Form.php" hash="2868fa7029a464236e5f55034e236f68"/></dir><file name="Grid.php" hash="17c4f7b926c64f92ce8132a9987f11f7"/><file name="View.php" hash="aaff72924e4ea4f77d5ef7a3f67624c8"/></dir><file name="Mail.php" hash="1a35a05e80aede11ce215e53dde18cdc"/></dir></dir><dir name="Helper"><file name="Data.php" hash="56cd1e0335dfd23d07be6274e2d72194"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Mail"><file name="Collection.php" hash="96f9c96a4de4fa01f4a79d67796308d4"/></dir><file name="Mail.php" hash="c3e297f1ca0304a4c829dd6cf6132dd3"/></dir><file name="Mail.php" hash="baa2510ef53101928b91bf867bc0de9e"/><file name="Observer.php" hash="e08a8b23bbc5b54d3871884356e8000a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailController.php" hash="abb180de1308420246aac4f4bad811f3"/></dir></dir><dir name="etc"><file name="config.xml" hash="27d2a0720f825f605f270d7d1e567da6"/><file name="system.xml" hash="9dcb70ee56b212c6df3b5cab70e05b85"/></dir><dir name="sql"><dir name="automaticresponse_setup"><file name="mysql4-install-0.1.0.php" hash="17a271fbb467d5561912e848686fe53a"/><file name="mysql4-upgrade-0.1.0-0.0.1.php" hash="cf2e22a1506e22327336fec942ff29b2"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="d20386a51c47a16517cb82473e86d9fc"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="sinabs"><dir name="automaticresponse"><dir name="mail"><file name="view.phtml" hash="7d9be7c6ab43688b97748556758fa93c"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sinabs_AutomaticResponse.xml" hash="4399395bf553d7b4abca7463c7cb8a6a"/></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Sinabs_AutomaticResponse.csv" hash="2998b8467c346f129d7257974629c8b2"/><dir name="template"><dir name="email"><file name="automatic_response.html" hash="5c3fda353ae00468b56453a40a4b208e"/></dir></dir></dir><dir name="en_US"><dir name="template"><dir name="email"><file name="automatic_response.html" hash="d12165e940add0bbad49be149b55981b"/></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><package><name>Sinabs_All</name><channel>community</channel><min>1.0.0</min><max></max></package></required></dependencies>
|
18 |
+
</package>
|