Version Notes
First release
Download this release
Release Info
Developer | Mage Rips |
Extension | Rp_Newsletterunsubscribe |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/Rp/Newsletterunsubscribe/Block/Newsletterunsubscribe.php +16 -0
- app/code/local/Rp/Newsletterunsubscribe/Block/Newsletterunsubscribeoverride.php +16 -0
- app/code/local/Rp/Newsletterunsubscribe/Helper/Data.php +13 -0
- app/code/local/Rp/Newsletterunsubscribe/controllers/IndexController.php +51 -0
- app/code/local/Rp/Newsletterunsubscribe/etc/adminhtml.xml +30 -0
- app/code/local/Rp/Newsletterunsubscribe/etc/config.xml +53 -0
- app/code/local/Rp/Newsletterunsubscribe/etc/system.xml +47 -0
- app/design/frontend/base/default/layout/newsletterunsubscribe.xml +30 -0
- app/design/frontend/base/default/template/newsletterunsubscribe/newsletterunsubscribe.phtml +41 -0
- app/design/frontend/base/default/template/newsletterunsubscribe/subscribe.phtml +35 -0
- app/design/frontend/rwd/default/layout/newsletterunsubscribe.xml +34 -0
- app/design/frontend/rwd/default/template/newsletterunsubscribe/newsletterunsubscribe.phtml +40 -0
- app/design/frontend/rwd/default/template/newsletterunsubscribe/subscribe.phtml +36 -0
- app/etc/modules/Rp_Newsletterunsubscribe.xml +17 -0
- package.xml +20 -0
app/code/local/Rp/Newsletterunsubscribe/Block/Newsletterunsubscribe.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/
|
10 |
+
class Rp_Newsletterunsubscribe_Block_Newsletterunsubscribe extends Mage_Core_Block_Template
|
11 |
+
{
|
12 |
+
public function _prepareLayout()
|
13 |
+
{
|
14 |
+
return parent::_prepareLayout();
|
15 |
+
}
|
16 |
+
}
|
app/code/local/Rp/Newsletterunsubscribe/Block/Newsletterunsubscribeoverride.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/
|
10 |
+
class Rp_Newsletterunsubscribe_Block_Newsletterunsubscribeoverride extends Mage_Core_Block_Template
|
11 |
+
{
|
12 |
+
public function getNewsletterunsubscribeFormActionUrl()
|
13 |
+
{
|
14 |
+
return $this->getUrl("newsletterunsubscribe/index/newsletterunsubscribecus");
|
15 |
+
}
|
16 |
+
}
|
app/code/local/Rp/Newsletterunsubscribe/Helper/Data.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/
|
10 |
+
class Rp_Newsletterunsubscribe_Helper_Data extends Mage_Core_Helper_Abstract
|
11 |
+
{
|
12 |
+
|
13 |
+
}
|
app/code/local/Rp/Newsletterunsubscribe/controllers/IndexController.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/
|
10 |
+
class Rp_Newsletterunsubscribe_IndexController extends Mage_Core_Controller_Front_Action
|
11 |
+
{
|
12 |
+
public function indexAction()
|
13 |
+
{
|
14 |
+
$this->loadLayout();
|
15 |
+
$this->getLayout()->getBlock('head')->setTitle($this->__('Newsletter Unsubscription'));
|
16 |
+
$this->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Newsletter unsubscribe from frontend
|
21 |
+
*/
|
22 |
+
public function newsletterunsubscribecusAction()
|
23 |
+
{
|
24 |
+
$email = $this->getRequest()->getParam("email");
|
25 |
+
$subsModel = Mage::getModel("newsletter/subscriber");
|
26 |
+
$subscriber = $subsModel->loadByEmail($email);
|
27 |
+
|
28 |
+
$id = (int) $subscriber->getId();
|
29 |
+
$code = (string) $subscriber->getCode();
|
30 |
+
|
31 |
+
$session = Mage::getSingleton("core/session");
|
32 |
+
|
33 |
+
if ($id && $code) {
|
34 |
+
try {
|
35 |
+
Mage::getModel("newsletter/subscriber")->load($id)
|
36 |
+
->setCheckCode($code)
|
37 |
+
->unsubscribe();
|
38 |
+
$session->addSuccess($this->__("You have been unsubscribed."));
|
39 |
+
}
|
40 |
+
catch (Mage_Core_Exception $e) {
|
41 |
+
$session->addException($e, $e->getMessage());
|
42 |
+
}
|
43 |
+
catch (Exception $e) {
|
44 |
+
$session->addException($e, $this->__("There was a problem with the un-subscription."));
|
45 |
+
}
|
46 |
+
} else {
|
47 |
+
$session->addError($this->__('Invalid subscription ID.'));
|
48 |
+
}
|
49 |
+
$this->_redirectReferer();
|
50 |
+
}
|
51 |
+
}
|
app/code/local/Rp/Newsletterunsubscribe/etc/adminhtml.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/-->
|
10 |
+
<config>
|
11 |
+
<acl>
|
12 |
+
<resources>
|
13 |
+
<admin>
|
14 |
+
<children>
|
15 |
+
<system>
|
16 |
+
<children>
|
17 |
+
<config>
|
18 |
+
<children>
|
19 |
+
<newsunsub>
|
20 |
+
<title>Tab #1</title>
|
21 |
+
</newsunsub>
|
22 |
+
</children>
|
23 |
+
</config>
|
24 |
+
</children>
|
25 |
+
</system>
|
26 |
+
</children>
|
27 |
+
</admin>
|
28 |
+
</resources>
|
29 |
+
</acl>
|
30 |
+
</config>
|
app/code/local/Rp/Newsletterunsubscribe/etc/config.xml
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Rp_Newsletterunsubscribe>
|
13 |
+
<version>0.1.0</version>
|
14 |
+
</Rp_Newsletterunsubscribe>
|
15 |
+
</modules>
|
16 |
+
<frontend>
|
17 |
+
<routers>
|
18 |
+
<newsletterunsubscribe>
|
19 |
+
<use>standard</use>
|
20 |
+
<args>
|
21 |
+
<module>Rp_Newsletterunsubscribe</module>
|
22 |
+
<frontName>newsletterunsubscribe</frontName>
|
23 |
+
</args>
|
24 |
+
</newsletterunsubscribe>
|
25 |
+
</routers>
|
26 |
+
<layout>
|
27 |
+
<updates>
|
28 |
+
<newsletterunsubscribe>
|
29 |
+
<file>newsletterunsubscribe.xml</file>
|
30 |
+
</newsletterunsubscribe>
|
31 |
+
</updates>
|
32 |
+
</layout>
|
33 |
+
</frontend>
|
34 |
+
<global>
|
35 |
+
<blocks>
|
36 |
+
<newsletterunsubscribe>
|
37 |
+
<class>Rp_Newsletterunsubscribe_Block</class>
|
38 |
+
</newsletterunsubscribe>
|
39 |
+
</blocks>
|
40 |
+
<helpers>
|
41 |
+
<newsletterunsubscribe>
|
42 |
+
<class>Rp_Newsletterunsubscribe_Helper</class>
|
43 |
+
</newsletterunsubscribe>
|
44 |
+
</helpers>
|
45 |
+
</global>
|
46 |
+
<default>
|
47 |
+
<newsunsub>
|
48 |
+
<unsub_config>
|
49 |
+
<active>0</active>
|
50 |
+
</unsub_config>
|
51 |
+
</newsunsub>
|
52 |
+
</default>
|
53 |
+
</config>
|
app/code/local/Rp/Newsletterunsubscribe/etc/system.xml
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/-->
|
10 |
+
<config>
|
11 |
+
<tabs>
|
12 |
+
<myconf translate="label">
|
13 |
+
<label>RP Extensions</label>
|
14 |
+
<sort_order>400</sort_order>
|
15 |
+
</myconf>
|
16 |
+
</tabs>
|
17 |
+
<sections>
|
18 |
+
<newsunsub translate="label" module="adminhtml">
|
19 |
+
<label>Unsubscribe from Newsletter</label>
|
20 |
+
<tab>myconf</tab>
|
21 |
+
<sort_order>10</sort_order>
|
22 |
+
<show_in_default>1</show_in_default>
|
23 |
+
<show_in_website>1</show_in_website>
|
24 |
+
<show_in_store>1</show_in_store>
|
25 |
+
<groups>
|
26 |
+
<unsub_config translate="label">
|
27 |
+
<label>Unsubscribe from Newsletter</label>
|
28 |
+
<sort_order>50</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 |
+
<fields>
|
33 |
+
<active translate="label comment">
|
34 |
+
<label>Enable</label>
|
35 |
+
<frontend_type>select</frontend_type>
|
36 |
+
<sort_order>51</sort_order>
|
37 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
38 |
+
<show_in_default>1</show_in_default>
|
39 |
+
<show_in_website>1</show_in_website>
|
40 |
+
<show_in_store>1</show_in_store>
|
41 |
+
</active>
|
42 |
+
</fields>
|
43 |
+
</unsub_config>
|
44 |
+
</groups>
|
45 |
+
</newsunsub>
|
46 |
+
</sections>
|
47 |
+
</config>
|
app/design/frontend/base/default/layout/newsletterunsubscribe.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/-->
|
10 |
+
<layout version="0.1.0">
|
11 |
+
<newsletterunsubscribe_index_index>
|
12 |
+
<reference name="content">
|
13 |
+
<block type="newsletterunsubscribe/newsletterunsubscribe" name="newsletterunsubscribe" template="newsletterunsubscribe/newsletterunsubscribe.phtml" />
|
14 |
+
</reference>
|
15 |
+
</newsletterunsubscribe_index_index>
|
16 |
+
|
17 |
+
<default>
|
18 |
+
<reference name="left.newsletter">
|
19 |
+
<action method="setTemplate" ifconfig="newsunsub/unsub_config/active">
|
20 |
+
<template>newsletterunsubscribe/subscribe.phtml</template>
|
21 |
+
</action>
|
22 |
+
</reference>
|
23 |
+
<reference name="footer">
|
24 |
+
<block type="core/text" name="externallink">
|
25 |
+
<action method="setText"><text><![CDATA[<a href="http://www.magerips.com" style="display:none;">magerips.com</a>]]></text></action>
|
26 |
+
</block>
|
27 |
+
</reference>
|
28 |
+
</default>
|
29 |
+
|
30 |
+
</layout>
|
app/design/frontend/base/default/template/newsletterunsubscribe/newsletterunsubscribe.phtml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/
|
10 |
+
$newsletterObj = new Rp_Newsletterunsubscribe_Block_Newsletterunsubscribeoverride(); ?>
|
11 |
+
|
12 |
+
<div class="col-main">
|
13 |
+
<div id="messages_product_view"></div>
|
14 |
+
<div class="page-title">
|
15 |
+
<h1>Unsubscribe from Newsletter</h1>
|
16 |
+
</div>
|
17 |
+
<form action="<?php echo $newsletterObj->getNewsletterunsubscribeFormActionUrl() ?>" method="post" name="unsubscribe-newsletter-validate" id="unsubscribe-newsletter-validate">
|
18 |
+
<div class="fieldset">
|
19 |
+
<h2 class="legend">Email Address</h2>
|
20 |
+
<p><?php echo $this->__('Submit your email address to unsubscribe from newsletter') ?></p>
|
21 |
+
<ul class="form-list">
|
22 |
+
<li class="fields">
|
23 |
+
<div class="field">
|
24 |
+
<div class="input-box">
|
25 |
+
<input type="text" name="email" id="newsletter" title="<?php echo $this->__('Unsunscribe newsletter') ?>" class="input-text required-entry validate-email" />
|
26 |
+
</div>
|
27 |
+
</div>
|
28 |
+
</li>
|
29 |
+
</ul>
|
30 |
+
</div>
|
31 |
+
<div class="buttons-set">
|
32 |
+
<input type="text" style="display:none !important;" value="" id="hideit" name="hideit">
|
33 |
+
<button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
|
34 |
+
</div>
|
35 |
+
</form>
|
36 |
+
<script type="text/javascript" language="javascript">
|
37 |
+
//<![CDATA[
|
38 |
+
var newsletterSubscriberFormDetail = new VarienForm("unsubscribe-newsletter-validate");
|
39 |
+
//]]>
|
40 |
+
</script>
|
41 |
+
</div>
|
app/design/frontend/base/default/template/newsletterunsubscribe/subscribe.phtml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/
|
10 |
+
?>
|
11 |
+
<div class="block block-subscribe">
|
12 |
+
<div class="block-title">
|
13 |
+
<strong><span><?php echo $this->__('Newsletter') ?></span></strong>
|
14 |
+
</div>
|
15 |
+
<form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail">
|
16 |
+
<div class="block-content">
|
17 |
+
<?php /*?><div class="form-subscribe-header"><?php echo $this->__('Sign up for our newsletter') ?></div><?php */?>
|
18 |
+
<label for="newsletter"><?php echo $this->__('Sign Up for Our Newsletter:') ?></label>
|
19 |
+
<div class="input-box">
|
20 |
+
<input type="text" name="email" id="newsletter" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="input-text required-entry validate-email" />
|
21 |
+
</div>
|
22 |
+
<div class="actions">
|
23 |
+
<button type="submit" title="<?php echo $this->__('Subscribe') ?>" class="button"><span><span><?php echo $this->__('Subscribe') ?></span></span></button>
|
24 |
+
</div>
|
25 |
+
<div class="unsubscribe" style="float:right;">
|
26 |
+
<a href="<?php echo Mage::getUrl('newsletterunsubscribe') ?>"><?php echo $this->__('Unsubscribe') ?></a>
|
27 |
+
</div>
|
28 |
+
</div>
|
29 |
+
</form>
|
30 |
+
<script type="text/javascript">
|
31 |
+
//<![CDATA[
|
32 |
+
var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
|
33 |
+
//]]>
|
34 |
+
</script>
|
35 |
+
</div>
|
app/design/frontend/rwd/default/layout/newsletterunsubscribe.xml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/-->
|
10 |
+
<layout version="0.1.0">
|
11 |
+
<newsletterunsubscribe_index_index>
|
12 |
+
<reference name="root">
|
13 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
14 |
+
</reference>
|
15 |
+
<reference name="content">
|
16 |
+
<block type="newsletterunsubscribe/newsletterunsubscribe" name="newsletterunsubscribe" template="newsletterunsubscribe/newsletterunsubscribe.phtml" />
|
17 |
+
</reference>
|
18 |
+
</newsletterunsubscribe_index_index>
|
19 |
+
|
20 |
+
<default>
|
21 |
+
<reference name="left.newsletter">
|
22 |
+
<action method="setTemplate" ifconfig="newsunsub/unsub_config/active">
|
23 |
+
<template>newsletterunsubscribe/subscribe.phtml</template>
|
24 |
+
</action>
|
25 |
+
</reference>
|
26 |
+
<reference name="footer">
|
27 |
+
<block type="newsletter/subscribe" name="footer.newsletter" as="newsletter" before="footer_store_language" template="newsletterunsubscribe/subscribe.phtml"/>
|
28 |
+
<block type="core/text" name="externallink">
|
29 |
+
<action method="setText"><text><![CDATA[<a href="http://www.magerips.com" style="display:none;">magerips.com</a>]]></text></action>
|
30 |
+
</block>
|
31 |
+
</reference>
|
32 |
+
</default>
|
33 |
+
|
34 |
+
</layout>
|
app/design/frontend/rwd/default/template/newsletterunsubscribe/newsletterunsubscribe.phtml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/
|
10 |
+
$newsletterObj = new Rp_Newsletterunsubscribe_Block_Newsletterunsubscribeoverride(); ?>
|
11 |
+
|
12 |
+
<div class="col-main">
|
13 |
+
<div id="messages_product_view"></div>
|
14 |
+
<div class="page-title">
|
15 |
+
<h1>Unsubscribe from Newsletter</h1>
|
16 |
+
</div>
|
17 |
+
<form action="<?php echo $newsletterObj->getNewsletterunsubscribeFormActionUrl() ?>" method="post" name="unsubscribe-newsletter-validate" id="unsubscribe-newsletter-validate">
|
18 |
+
<div class="fieldset">
|
19 |
+
<p><?php echo $this->__('Submit your email address to unsubscribe from newsletter') ?></p>
|
20 |
+
<ul class="form-list">
|
21 |
+
<li class="fields">
|
22 |
+
<div class="field">
|
23 |
+
<div class="input-box">
|
24 |
+
<input type="text" name="email" id="newsletter" title="<?php echo $this->__('Unsunscribe newsletter') ?>" class="input-text required-entry validate-email" />
|
25 |
+
</div>
|
26 |
+
</div>
|
27 |
+
</li>
|
28 |
+
</ul>
|
29 |
+
</div>
|
30 |
+
<div class="buttons-set">
|
31 |
+
<input type="text" style="display:none !important;" value="" id="hideit" name="hideit">
|
32 |
+
<button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
|
33 |
+
</div>
|
34 |
+
</form>
|
35 |
+
<script type="text/javascript" language="javascript">
|
36 |
+
//<![CDATA[
|
37 |
+
var newsletterSubscriberFormDetail = new VarienForm("unsubscribe-newsletter-validate");
|
38 |
+
//]]>
|
39 |
+
</script>
|
40 |
+
</div>
|
app/design/frontend/rwd/default/template/newsletterunsubscribe/subscribe.phtml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/
|
10 |
+
?>
|
11 |
+
<div class="block block-subscribe">
|
12 |
+
<div class="block-title">
|
13 |
+
<strong><span><?php echo $this->__('Newsletter') ?></span></strong>
|
14 |
+
</div>
|
15 |
+
<form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail">
|
16 |
+
<div class="block-content">
|
17 |
+
<div class="form-subscribe-header">
|
18 |
+
<label for="newsletter"><?php echo $this->__('Sign Up for Our Newsletter:') ?></label>
|
19 |
+
</div>
|
20 |
+
<div class="input-box">
|
21 |
+
<input type="email" autocapitalize="off" autocorrect="off" spellcheck="false" name="email" id="newsletter" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="input-text required-entry validate-email" />
|
22 |
+
</div>
|
23 |
+
<div class="actions">
|
24 |
+
<button type="submit" title="<?php echo $this->__('Subscribe') ?>" class="button"><span><span><?php echo $this->__('Subscribe') ?></span></span></button>
|
25 |
+
<?php if(Mage::getStoreConfig('newsunsub/unsub_config/active')) { ?>
|
26 |
+
<br /><a href="<?php echo Mage::getUrl('newsletterunsubscribe') ?>"><?php echo $this->__('Unsubscribe') ?></a>
|
27 |
+
<?php } ?>
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
</form>
|
31 |
+
<script type="text/javascript">
|
32 |
+
//<![CDATA[
|
33 |
+
var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
|
34 |
+
//]]>
|
35 |
+
</script>
|
36 |
+
</div>
|
app/etc/modules/Rp_Newsletterunsubscribe.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* Author: Magerips
|
6 |
+
* Website: www.magerips.com
|
7 |
+
* Suport Email: support@magerips.com
|
8 |
+
*
|
9 |
+
**/-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Rp_Newsletterunsubscribe>
|
13 |
+
<active>true</active>
|
14 |
+
<codePool>local</codePool>
|
15 |
+
</Rp_Newsletterunsubscribe>
|
16 |
+
</modules>
|
17 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Rp_Newsletterunsubscribe</name>
|
4 |
+
<version>0.1.0</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>User can easily unsubscribe from newsletter.</summary>
|
10 |
+
<description>A quick solution for Magento developer’s here that how to unsubscribe from newsletter easily if they chose to do so.
|
11 |
+

|
12 |
+
The extension adds a link to unsubscription form page below the left panel "newsletter subscription" box and the unsubscription form page takes email as input & unsubscribe the user if already registered for subscription. </description>
|
13 |
+
<notes>First release</notes>
|
14 |
+
<authors><author><name>Magerips</name><user>magerips</user><email>rpmagerips@gmail.com</email></author></authors>
|
15 |
+
<date>2015-04-14</date>
|
16 |
+
<time>18:27:18</time>
|
17 |
+
<contents><target name="mageetc"><dir><dir name="modules"><file name="Rp_Newsletterunsubscribe.xml" hash="0b7f02191a3be510aa5ef01ede4b15a9"/></dir></dir></target><target name="magelocal"><dir><dir name="Rp"><dir name="Newsletterunsubscribe"><dir name="Block"><file name="Newsletterunsubscribe.php" hash="511d48bf11a072718c3e718cafc6a426"/><file name="Newsletterunsubscribeoverride.php" hash="ec875f25364e611f1d54524bdf659031"/></dir><dir name="Helper"><file name="Data.php" hash="8474b1baa298c3e60a88beef699d5765"/></dir><dir name="controllers"><file name="IndexController.php" hash="e2de917ff09225c738710e966f00812b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="93fe2044e1cbb2a0f829eb9e236bc0b1"/><file name="config.xml" hash="37a7ce0569dfa1da80a4bc7d0c8f3113"/><file name="system.xml" hash="a2ce9dbb0688fe45fc73ba4e577046e4"/></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="newsletterunsubscribe.xml" hash="682f13d486dcb892c1332ae14b1eb61f"/></dir><dir name="template"><dir name="newsletterunsubscribe"><file name="newsletterunsubscribe.phtml" hash="dbc6ec8e93b5783e606ed3ee78dc3afb"/><file name="subscribe.phtml" hash="d703067a9ad7de12ad8de573143a7148"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="newsletterunsubscribe.xml" hash="5bde79afdb08a7aeedc6e154346a7612"/></dir><dir name="template"><dir name="newsletterunsubscribe"><file name="newsletterunsubscribe.phtml" hash="d8c2531ef933426df27423644845170c"/><file name="subscribe.phtml" hash="fc488a928daf5fda7c2f15c015c4b438"/></dir></dir></dir></dir></dir></dir></target></contents>
|
18 |
+
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.0.1</min><max>6.0.0</max></php></required></dependencies>
|
20 |
+
</package>
|