Version Notes
First Preview Release
Download this release
Release Info
Developer | NetGo |
Extension | Netgo_Groupchangenotification |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Netgo/Groupchangenotification/Helper/Data.php +7 -0
- app/code/community/Netgo/Groupchangenotification/Model/Observer.php +37 -0
- app/code/community/Netgo/Groupchangenotification/etc/adminhtml.xml +23 -0
- app/code/community/Netgo/Groupchangenotification/etc/config.xml +43 -0
- app/code/community/Netgo/Groupchangenotification/etc/system.xml +41 -0
- app/etc/modules/Netgo_Groupchangenotification.xml +9 -0
- app/locale/en_US/template/email/group_change_template.html +39 -0
- package.xml +20 -0
app/code/community/Netgo/Groupchangenotification/Helper/Data.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Netgo_Groupchangenotification_Helper_Data extends Mage_Core_Helper_Abstract{
|
3 |
+
public function __construct(){
|
4 |
+
}
|
5 |
+
}
|
6 |
+
|
7 |
+
|
app/code/community/Netgo/Groupchangenotification/Model/Observer.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Netgo_Groupchangenotification_Model_Observer
|
3 |
+
{
|
4 |
+
public function changeGroup(Varien_Event_Observer $observer){
|
5 |
+
$customer = $observer->getEvent()->getCustomer();
|
6 |
+
|
7 |
+
$status = Mage::getStoreConfig('groupchangenotification/groupchangenotification/gcnenable');
|
8 |
+
if($status == 1){
|
9 |
+
/* Code for old customer */
|
10 |
+
if($customer->getId()){
|
11 |
+
$template_id = 'group_change_template';
|
12 |
+
if($customer->getOrigData('group_id')!= $customer->getData('group_id')){
|
13 |
+
|
14 |
+
$groupname = Mage::getModel('customer/group')->load($customer->getData('group_id'))->getCustomerGroupCode();
|
15 |
+
$name= $customer->getName();
|
16 |
+
|
17 |
+
$to= $customer->getEmail();
|
18 |
+
$customer_name = $name;
|
19 |
+
$email_template = Mage::getModel('core/email_template')->loadDefault($template_id);
|
20 |
+
$email_template_variables = array(
|
21 |
+
'customer_name' => $customer_name,
|
22 |
+
'groupname' => $groupname
|
23 |
+
);
|
24 |
+
$sender_name = Mage::getStoreConfig(Mage_Core_Model_Store::XML_PATH_STORE_STORE_NAME);
|
25 |
+
$sender_email = Mage::getStoreConfig('trans_email/ident_general/email');
|
26 |
+
$email_template->setSenderName($sender_name);
|
27 |
+
$email_template->setSenderEmail($sender_email);
|
28 |
+
|
29 |
+
$email_template->send($to, $customer_name, $email_template_variables);
|
30 |
+
|
31 |
+
}else{
|
32 |
+
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Netgo/Groupchangenotification/etc/adminhtml.xml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<groupchangenotification translate="title" module="groupchangenotification">
|
12 |
+
<title>Flickr Feeds</title>
|
13 |
+
<sort_order>0</sort_order>
|
14 |
+
</groupchangenotification>
|
15 |
+
</children>
|
16 |
+
</config>
|
17 |
+
</children>
|
18 |
+
</system>
|
19 |
+
</children>
|
20 |
+
</admin>
|
21 |
+
</resources>
|
22 |
+
</acl>
|
23 |
+
</config>
|
app/code/community/Netgo/Groupchangenotification/etc/config.xml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Netgo_Groupchangenotification>
|
5 |
+
<version>0.0.1</version>
|
6 |
+
</Netgo_Groupchangenotification>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<netgo_groupchangenotification>
|
11 |
+
<class>Netgo_Groupchangenotification_Model</class>
|
12 |
+
</netgo_groupchangenotification>
|
13 |
+
</models>
|
14 |
+
<template>
|
15 |
+
<email>
|
16 |
+
<group_change_template>
|
17 |
+
<label>Group Change Template</label>
|
18 |
+
<file>group_change_template.html</file>
|
19 |
+
<type>html</type>
|
20 |
+
</group_change_template>
|
21 |
+
</email>
|
22 |
+
</template>
|
23 |
+
|
24 |
+
<helpers>
|
25 |
+
<groupchangenotification>
|
26 |
+
<class>Netgo_Groupchangenotification_Helper</class>
|
27 |
+
</groupchangenotification>
|
28 |
+
</helpers>
|
29 |
+
|
30 |
+
</global>
|
31 |
+
<adminhtml>
|
32 |
+
<events>
|
33 |
+
<customer_save_after><!-- observe the event -->
|
34 |
+
<observers>
|
35 |
+
<netgo_groupchangenotification>
|
36 |
+
<class>netgo_groupchangenotification/observer</class>
|
37 |
+
<method>changeGroup</method>
|
38 |
+
</netgo_groupchangenotification>
|
39 |
+
</observers>
|
40 |
+
</customer_save_after>
|
41 |
+
</events>
|
42 |
+
</adminhtml>
|
43 |
+
</config>
|
app/code/community/Netgo/Groupchangenotification/etc/system.xml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<netgogroupchangenotification translate="label" module="groupchangenotification">
|
5 |
+
<label>NetGo</label>
|
6 |
+
<sort_order>0</sort_order>
|
7 |
+
</netgogroupchangenotification>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<groupchangenotification translate="label" module="groupchangenotification">
|
11 |
+
<label>Group Change Notification</label>
|
12 |
+
<tab>netgogroupchangenotification</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>0</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<groupchangenotification translate="label">
|
20 |
+
<label>Group Change Notification</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>0</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<fields>
|
27 |
+
<gcnenable translate="label">
|
28 |
+
<label>Enable</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
+
<sort_order>1</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
</gcnenable>
|
36 |
+
</fields>
|
37 |
+
</groupchangenotification>
|
38 |
+
</groups>
|
39 |
+
</groupchangenotification>
|
40 |
+
</sections>
|
41 |
+
</config>
|
app/etc/modules/Netgo_Groupchangenotification.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Netgo_Groupchangenotification>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Netgo_Groupchangenotification>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/locale/en_US/template/email/group_change_template.html
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject Group Change Notification! @-->
|
2 |
+
|
3 |
+
<!--@vars
|
4 |
+
{"store url=\"\"":"Store Url",
|
5 |
+
"var logo_url":"Email Logo Image Url",
|
6 |
+
"htmlescape var=$customer.name":"Customer Name",
|
7 |
+
"store url=\"customer/account/\"":"Customer Account Url",
|
8 |
+
"var customer.email":"Customer Email",
|
9 |
+
"htmlescape var=$customer.password":"Customer Password"}
|
10 |
+
@-->
|
11 |
+
|
12 |
+
<!--@styles
|
13 |
+
@-->
|
14 |
+
|
15 |
+
{{template config_path="design/email/header"}}
|
16 |
+
{{inlinecss file="email-inline.css"}}
|
17 |
+
|
18 |
+
<table cellspacing="0" cellpadding="0" border="0">
|
19 |
+
<tr>
|
20 |
+
<td class="action-content">
|
21 |
+
<h3>Dear {{var customer_name}},</h3>
|
22 |
+
<p>Your group has been changed to <strong>{{var groupname}}</strong>.</p>
|
23 |
+
<p>You have become our <strong>{{var groupname}}</strong> customer.</p>
|
24 |
+
<p>When you log in to your account, you will be able to do the following:</p>
|
25 |
+
<ul>
|
26 |
+
<li>Proceed through checkout faster when making a purchase</li>
|
27 |
+
<li>Check the status of orders</li>
|
28 |
+
<li>View past orders</li>
|
29 |
+
<li>Make changes to your account information</li>
|
30 |
+
<li>Change your password</li>
|
31 |
+
<li>Store alternative addresses (for shipping to multiple family members and friends!)</li>
|
32 |
+
</ul>
|
33 |
+
<p>If you have any questions, please feel free to contact us at <a href="mailto:{{var store_email}}">{{var store_email}}</a>{{depend store_phone}} or by phone at <a href="tel:{{var phone}}">{{var store_phone}}</a>{{/depend}}.
|
34 |
+
</p>
|
35 |
+
</td>
|
36 |
+
</tr>
|
37 |
+
</table>
|
38 |
+
|
39 |
+
{{template config_path="design/email/footer"}}
|
package.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Netgo_Groupchangenotification</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>This extension helps to send mail to customers when ever their group will be changed by admin.</summary>
|
10 |
+
<description>This extension sends mail to customers when ever admin will change their group. This extension has solved the problem to write manual email and send it to each individual customers. There is no need to write manual email by admin. 
|
11 |
+

|
12 |
+
This extension automatically notify customers about changing their group when admin will change their group.</description>
|
13 |
+
<notes>First Preview Release</notes>
|
14 |
+
<authors><author><name>NetGo</name><user>NetGo</user><email>netattingomails@gmail.com</email></author></authors>
|
15 |
+
<date>2015-10-05</date>
|
16 |
+
<time>06:30:51</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Netgo"><dir name="Groupchangenotification"><dir name="Helper"><file name="Data.php" hash="c6db6eb3ebc374e4f5ff7330e272cf5b"/></dir><dir name="Model"><file name="Observer.php" hash="d39153135ebfe1787dddf4e0f321df33"/></dir><dir name="etc"><file name="adminhtml.xml" hash="debd5bb70ed029962bcc22bf1054cbb1"/><file name="config.xml" hash="eebae8b09a805130d4e962215a2ea734"/><file name="system.xml" hash="cc7746bf84eee3bbd21dd38b50a5564a"/></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="group_change_template.html" hash="bc75367d82ee5cea352632e8889d05e6"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Netgo_Groupchangenotification.xml" hash="17ecaa9983f4e1d44c0cd33b3eff2ca5"/></dir></target></contents>
|
18 |
+
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
+
</package>
|