GlyphWebCore_NewsletterTest - Version 1.0.0

Version Notes

Initial Release

Download this release

Release Info

Developer Harish Kumar B P
Extension GlyphWebCore_NewsletterTest
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/GlyphWebCore/NewsletterTest/.DS_Store ADDED
Binary file
app/code/community/GlyphWebCore/NewsletterTest/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class GlyphWebCore_NewsletterTest_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/community/GlyphWebCore/NewsletterTest/controllers/.DS_Store ADDED
Binary file
app/code/community/GlyphWebCore/NewsletterTest/controllers/Adminhtml/.DS_Store ADDED
Binary file
app/code/community/GlyphWebCore/NewsletterTest/controllers/Adminhtml/SendTestController.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class GlyphWebCore_NewsletterTest_Adminhtml_SendTestController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+
6
+
7
+
8
+ public function indexAction()
9
+ {
10
+ $this->loadLayout();
11
+ $this->renderLayout();
12
+ }
13
+
14
+
15
+
16
+
17
+ public function postAction()
18
+ {
19
+ $post = $this->getRequest()->getPost();
20
+ $sql = "SELECT * FROM newsletter_queue WHERE queue_id =".$post['id'];
21
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
22
+
23
+ foreach($connection->fetchAll($sql) as $myrow)
24
+ {
25
+ $sender = $myrow['newsletter_sender_email'];
26
+ $subject = $myrow['newsletter_subject'];
27
+ $message = $myrow['newsletter_text'];
28
+ }
29
+
30
+ try
31
+ {
32
+ if(empty($post))
33
+ {
34
+ Mage::throwException($this->__('Invalid form data.'));
35
+ }
36
+
37
+ $mail = new Zend_Mail();
38
+ $mail->setFrom($sender);
39
+ $mail->setBodyHtml($message);
40
+ $mail->addTo($post['email'], $post['name']);
41
+ $mail->setSubject($subject);
42
+ $mail->send();
43
+
44
+ $message = $this->__("Newsletter sent to ".$post['email'].". Please check both your Inbox and Spam folders for the Newsletter Test Email.");
45
+ Mage::getSingleton('adminhtml/session')->addSuccess($message);
46
+ }
47
+ catch (Exception $e)
48
+ {
49
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
50
+ }
51
+
52
+ $this->_redirect('*/*/');
53
+ }
54
+
55
+ }
app/code/community/GlyphWebCore/NewsletterTest/etc/.DS_Store ADDED
Binary file
app/code/community/GlyphWebCore/NewsletterTest/etc/config.xml ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <GlyphWebCore_NewsletterTest>
5
+ <version>0.1.0</version>
6
+ </GlyphWebCore_NewsletterTest>
7
+ </modules>
8
+
9
+ <global>
10
+ <helpers>
11
+ <newslettertest>
12
+ <class>GlyphWebCore_NewsletterTest_Helper</class>
13
+ </newslettertest>
14
+ </helpers>
15
+ <blocks>
16
+ <newslettertest>
17
+ <class>GlyphWebCore_NewsletterTest_Block</class>
18
+ </newslettertest>
19
+ </blocks>
20
+ <models>
21
+ <glyphwebcore_newslettertest>
22
+ <class>GlyphWebCore_NewsletterTest_Model</class>
23
+ </glyphwebcore_newslettertest>
24
+ </models>
25
+ </global>
26
+
27
+ <admin>
28
+ <routers>
29
+ <newslettertest>
30
+ <use>admin</use>
31
+ <args>
32
+ <module>GlyphWebCore_NewsletterTest</module>
33
+ <frontName>newslettertest</frontName>
34
+ </args>
35
+ </newslettertest>
36
+ </routers>
37
+ </admin>
38
+
39
+ <adminhtml>
40
+ <menu>
41
+ <newsletter>
42
+ <children>
43
+ <newslettertest_sendtest translate="title" module="newslettertest">
44
+ <title>Send Test Newsletter</title>
45
+ <action>newslettertest/adminhtml_sendtest</action>
46
+ </newslettertest_sendtest>
47
+ </children>
48
+ </newsletter>
49
+ </menu>
50
+ <acl>
51
+ <resources>
52
+ <admin>
53
+ <children>
54
+ <newsletter>
55
+ <children>
56
+ <newslettertest_sendtest>
57
+ <title>Send Test Newsletter</title>
58
+ </newslettertest_sendtest>
59
+ </children>
60
+ </newsletter>
61
+ </children>
62
+ </admin>
63
+ </resources>
64
+ </acl>
65
+ <layout>
66
+ <updates>
67
+ <glyphwebcore_newslettertest>
68
+ <file>glyphwebcore/newslettertest.xml</file>
69
+ </glyphwebcore_newslettertest>
70
+ </updates>
71
+ </layout>
72
+ </adminhtml>
73
+
74
+ </config>
app/design/adminhtml/default/default/layout/glyphwebcore/newslettertest.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <newslettertest_adminhtml_sendtest_index>
4
+ <update handle="newslettertest_sendtest_index"/>
5
+ <reference name="content">
6
+ <block type="adminhtml/template" name="sendtest" template="glyphwebcore/newslettertest/sendtest.phtml"/>
7
+ </reference>
8
+ </newslettertest_adminhtml_sendtest_index>
9
+ </layout>
app/design/adminhtml/default/default/template/glyphwebcore/newslettertest/.DS_Store ADDED
Binary file
app/design/adminhtml/default/default/template/glyphwebcore/newslettertest/sendtest.phtml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="content-header">
2
+ <table cellspacing="0" class="grid-header">
3
+ <tr>
4
+ <td><h3><?=$this->__('Newsletter Test')?></h3></td>
5
+ <td class="a-right">
6
+
7
+ </td>
8
+ </tr>
9
+ </table>
10
+ </div>
11
+
12
+ <?php
13
+
14
+ $prefix = "";
15
+ $myoptions = "";
16
+
17
+ $prefix = Mage::getConfig()->getTablePrefix();
18
+
19
+ $sql = "SELECT * FROM ".$prefix."newsletter_queue WHERE queue_status = 0";
20
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
21
+ foreach ($connection->fetchAll($sql) as $arr_row) {
22
+ //echo "Subject = " . $arr_row['newsletter_subject'] . "<br>";
23
+ $myoptions = $myoptions."<option value='".$arr_row['queue_id']."'>".$arr_row['newsletter_subject']."</option>\n";
24
+ }
25
+
26
+ ?>
27
+
28
+ <div class="entry-edit">
29
+
30
+ <form id="edit_form" name="edit_form" method="post" action="<?=$this->getUrl('*/*/post')?>">
31
+ <input name="form_add" type="hidden" value="getnow" />
32
+ <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
33
+ <h4 class="icon-head head-edit-form fieldset-legend"><?=$this->__('Send Newsletter Test Email')?></h4>
34
+ <fieldset id="my-fieldset">
35
+ <table cellspacing="0" class="form-list">
36
+ <tr>
37
+ <td class="label"><?=$this->__('Your Name')?> <span class="required">*</span></td>
38
+ <td class="input-ele"><input type="text" class="input-text required-entry" name="name" style="width:220px;"/><br>
39
+ </td>
40
+ </tr>
41
+ <tr>
42
+ <td class="label"><?=$this->__('Your Email')?> <span class="required">*</span></td>
43
+ <td class="input-ele"><input type="text" class="input-text required-entry" name="email" style="width:220px;"/><br>
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td class="label"><?=$this->__('Choose Newsletter Queue')?> <span class="required">*</span></td>
48
+ <td class="input-ele">
49
+ <select name="id" id="id" style="width:220px;" class="required-select">
50
+ <?php echo $myoptions;?>
51
+ </select>
52
+ </td>
53
+ </tr>
54
+ <tr>
55
+ <td class="label"></td>
56
+ <td class="input-ele"><br><button onclick="editForm.submit()" class="scalable save" type="button"><span>Submit</span></button></td>
57
+ </tr>
58
+ </table>
59
+ </fieldset>
60
+ </form>
61
+
62
+ </div>
63
+
64
+ <script type="text/javascript">
65
+ var editForm = new varienForm('edit_form');
66
+ </script>
67
+
app/etc/modules/GlyphWebCore_NewsletterTest.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <GlyphWebCore_NewsletterTest>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </GlyphWebCore_NewsletterTest>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>GlyphWebCore_NewsletterTest</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Send a Test Newsletter to an email to check how the customers will receive your Newsletter.</summary>
10
+ <description>Ever wanted to know how your Newsletter looks like before sending it to your customers? Yes, Magento provides you a preview of the Newsletter, but, sometimes, the format of the Newsletter received to an email client can be different than what you see in the Magento Newsletter preview.&#xD;
11
+ &#xD;
12
+ Now, you can send a copy of the Newsletter as a test to any email and check how it will look for your customers in their email.&#xD;
13
+ &#xD;
14
+ NOTE: In the Test Newsletter that you receive, variables will NOT be replaced with Links. For example,"{{var subscriber.getUnsubscriptionLink()}}" will not be replaced with the actual unsubscribe URL.</description>
15
+ <notes>Initial Release</notes>
16
+ <authors><author><name>Harish Kumar B P</name><user>harish_bp</user><email>harishbp@magedevelopment.com</email></author></authors>
17
+ <date>2013-10-25</date>
18
+ <time>21:18:43</time>
19
+ <contents><target name="magecommunity"><dir name="GlyphWebCore"><dir name="NewsletterTest"><dir name="Helper"><file name="Data.php" hash="d3a1cd9454346e9dd6e10aa136987747"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SendTestController.php" hash="a746bf58f135e852b8cb123230992688"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="ed95c546eedb16b600a0ad7b25710c34"/></dir><dir name="etc"><file name="config.xml" hash="61f78e0cf02bebdb7ada6927c121d1c6"/><file name=".DS_Store" hash="f7cad3e2cf161faad95bd5d82cf6247c"/></dir><file name=".DS_Store" hash="41775c7cba1d509412978bb5f7ad9103"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="GlyphWebCore_NewsletterTest.xml" hash="ba5b6f9a14dfeb87f8736792a27d98e8"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="glyphwebcore"><file name="newslettertest.xml" hash="47de848e1847d7c3ab855bcb7cdf4088"/></dir></dir><dir name="template"><dir name="glyphwebcore"><dir name="newslettertest"><file name="sendtest.phtml" hash="e0f35af58b4754d57bbc51d6aa4be2b6"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></dir></dir></dir></target></contents>
20
+ <compatible/>
21
+ <dependencies><required><php><min>5.2.0</min><max>5.5.0</max></php></required></dependencies>
22
+ </package>