Version Notes
SMS notification
Download this release
Release Info
Developer | Carotechs |
Extension | Carotechs_Smsnotify |
Version | 0.1.3 |
Comparing to | |
See all releases |
Code changes from version 0.1.1 to 0.1.3
app/code/local/Carotechs/Smsnotify/Helper/Data.php
CHANGED
@@ -39,6 +39,11 @@ class Carotechs_Smsnotify_Helper_Data extends Mage_Core_Helper_Data
|
|
39 |
return Mage::getStoreConfig(self::CONFIG_PATH.'general/message_field');
|
40 |
}
|
41 |
|
|
|
|
|
|
|
|
|
|
|
42 |
public function getSentMethod()
|
43 |
{
|
44 |
return Mage::getStoreConfig(self::CONFIG_PATH.'general/urlmethod');
|
@@ -72,8 +77,8 @@ class Carotechs_Smsnotify_Helper_Data extends Mage_Core_Helper_Data
|
|
72 |
public function getMessage(Mage_Sales_Model_Order $order)
|
73 |
{
|
74 |
$billingAddress = $order->getBillingAddress();
|
75 |
-
$whatArray = array('{{firstname}}');
|
76 |
-
$withWhatArray = array($billingAddress->getFirstname());
|
77 |
|
78 |
return str_replace($whatArray,$withWhatArray,Mage::getStoreConfig(self::CONFIG_PATH.'orders/message'));
|
79 |
}
|
@@ -211,8 +216,8 @@ class Carotechs_Smsnotify_Helper_Data extends Mage_Core_Helper_Data
|
|
211 |
|
212 |
public function file_get_contents_curl($url)
|
213 |
{
|
214 |
-
|
215 |
-
//
|
216 |
$ch = curl_init();
|
217 |
|
218 |
curl_setopt($ch, CURLOPT_HEADER, 0);
|
@@ -228,8 +233,8 @@ class Carotechs_Smsnotify_Helper_Data extends Mage_Core_Helper_Data
|
|
228 |
public function file_get_contents_curl_POST($url,$data)
|
229 |
{
|
230 |
//echo $url;
|
231 |
-
//
|
232 |
-
|
233 |
$ch = curl_init($url);
|
234 |
curl_setopt($ch, CURLOPT_POST, true);
|
235 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
39 |
return Mage::getStoreConfig(self::CONFIG_PATH.'general/message_field');
|
40 |
}
|
41 |
|
42 |
+
public function getToField()
|
43 |
+
{
|
44 |
+
return Mage::getStoreConfig(self::CONFIG_PATH.'general/to_field');
|
45 |
+
}
|
46 |
+
|
47 |
public function getSentMethod()
|
48 |
{
|
49 |
return Mage::getStoreConfig(self::CONFIG_PATH.'general/urlmethod');
|
77 |
public function getMessage(Mage_Sales_Model_Order $order)
|
78 |
{
|
79 |
$billingAddress = $order->getBillingAddress();
|
80 |
+
$whatArray = array('{{firstname}}','{{order_id}}');
|
81 |
+
$withWhatArray = array($billingAddress->getFirstname(),$order->getIncrementId());
|
82 |
|
83 |
return str_replace($whatArray,$withWhatArray,Mage::getStoreConfig(self::CONFIG_PATH.'orders/message'));
|
84 |
}
|
216 |
|
217 |
public function file_get_contents_curl($url)
|
218 |
{
|
219 |
+
// echo $url;
|
220 |
+
//die();
|
221 |
$ch = curl_init();
|
222 |
|
223 |
curl_setopt($ch, CURLOPT_HEADER, 0);
|
233 |
public function file_get_contents_curl_POST($url,$data)
|
234 |
{
|
235 |
//echo $url;
|
236 |
+
//print_r($data);
|
237 |
+
// die();
|
238 |
$ch = curl_init($url);
|
239 |
curl_setopt($ch, CURLOPT_POST, true);
|
240 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
app/code/local/Carotechs/Smsnotify/Model/Observer.php
CHANGED
@@ -3,30 +3,37 @@ class Carotechs_Smsnotify_Model_Observer
|
|
3 |
{
|
4 |
public function sendSmsOnOrderCreated(Varien_Event_Observer $observer)
|
5 |
{
|
6 |
-
|
7 |
if($this->getHelper()->isOrdersEnabled())
|
8 |
{
|
9 |
$orders = $observer->getEvent()->getOrderIds();
|
10 |
$order = Mage::getModel('sales/order')->load($orders['0']);
|
|
|
11 |
if ($order instanceof Mage_Sales_Model_Order)
|
12 |
{
|
13 |
$api_url = $this->getHelper()->getAPI();
|
14 |
$message_field_name = $this->getHelper()->getMessageField();
|
|
|
|
|
15 |
if($message_field_name=='')
|
16 |
{
|
17 |
-
$message_field_name = '
|
|
|
|
|
|
|
|
|
18 |
}
|
|
|
19 |
$sent_method = $this->getHelper()->getSentMethod();
|
20 |
|
21 |
-
$smsto = $this->getHelper()->getTelephoneFromOrder($order);
|
22 |
-
$smsmsg = $this->getHelper()->getMessage($order);
|
23 |
|
24 |
-
|
25 |
-
$data .= '&'.$message_field_name.'=' . urlencode($smsmsg);
|
26 |
-
$api_url = str_replace('{{mobile_no}}',$smsto,$api_url);
|
27 |
-
|
28 |
if($sent_method)
|
29 |
{
|
|
|
|
|
|
|
|
|
30 |
$method = 'GET';
|
31 |
$url = $api_url.$data;
|
32 |
$sendSms = $this->getHelper()->sendSms($url);
|
@@ -34,8 +41,10 @@ class Carotechs_Smsnotify_Model_Observer
|
|
34 |
else
|
35 |
{
|
36 |
$method = 'POST';
|
|
|
|
|
37 |
$url = $api_url;
|
38 |
-
$sendSms = $this->getHelper()->sendSms($url,$
|
39 |
}
|
40 |
|
41 |
}
|
@@ -45,27 +54,35 @@ class Carotechs_Smsnotify_Model_Observer
|
|
45 |
public function sendSmsOnOrderHold(Varien_Event_Observer $observer)
|
46 |
{
|
47 |
if($this->getHelper()->isOrderHoldEnabled()) {
|
48 |
-
$
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
52 |
$api_url = $this->getHelper()->getAPI();
|
53 |
$message_field_name = $this->getHelper()->getMessageField();
|
|
|
|
|
54 |
if($message_field_name=='')
|
55 |
{
|
56 |
-
$message_field_name = '
|
57 |
}
|
|
|
|
|
|
|
|
|
|
|
58 |
$sent_method = $this->getHelper()->getSentMethod();
|
59 |
|
60 |
-
$smsto = $this->getHelper()->getTelephoneFromOrder($order);
|
61 |
-
$smsmsg = $this->getHelper()->
|
62 |
|
63 |
-
|
64 |
-
$data .= '&'.$message_field_name.'=' . urlencode($smsmsg);
|
65 |
-
$api_url = str_replace('{{mobile_no}}',$smsto,$api_url);
|
66 |
-
|
67 |
if($sent_method)
|
68 |
{
|
|
|
|
|
|
|
|
|
69 |
$method = 'GET';
|
70 |
$url = $api_url.$data;
|
71 |
$sendSms = $this->getHelper()->sendSms($url);
|
@@ -73,12 +90,12 @@ class Carotechs_Smsnotify_Model_Observer
|
|
73 |
else
|
74 |
{
|
75 |
$method = 'POST';
|
|
|
|
|
76 |
$url = $api_url;
|
77 |
-
$sendSms = $this->getHelper()->sendSms($url,$
|
78 |
}
|
79 |
|
80 |
-
|
81 |
-
}
|
82 |
}
|
83 |
}
|
84 |
}
|
@@ -86,27 +103,35 @@ class Carotechs_Smsnotify_Model_Observer
|
|
86 |
public function sendSmsOnOrderUnhold(Varien_Event_Observer $observer)
|
87 |
{
|
88 |
if($this->getHelper()->isOrderUnholdEnabled()) {
|
89 |
-
$
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
93 |
$api_url = $this->getHelper()->getAPI();
|
94 |
$message_field_name = $this->getHelper()->getMessageField();
|
|
|
|
|
95 |
if($message_field_name=='')
|
96 |
{
|
97 |
-
$message_field_name = '
|
98 |
}
|
|
|
|
|
|
|
|
|
|
|
99 |
$sent_method = $this->getHelper()->getSentMethod();
|
100 |
|
101 |
-
$smsto = $this->getHelper()->getTelephoneFromOrder($order);
|
102 |
-
$smsmsg = $this->getHelper()->
|
103 |
|
104 |
-
|
105 |
-
$data .= '&'.$message_field_name.'=' . urlencode($smsmsg);
|
106 |
-
$api_url = str_replace('{{mobile_no}}',$smsto,$api_url);
|
107 |
-
|
108 |
if($sent_method)
|
109 |
{
|
|
|
|
|
|
|
|
|
110 |
$method = 'GET';
|
111 |
$url = $api_url.$data;
|
112 |
$sendSms = $this->getHelper()->sendSms($url);
|
@@ -114,11 +139,12 @@ class Carotechs_Smsnotify_Model_Observer
|
|
114 |
else
|
115 |
{
|
116 |
$method = 'POST';
|
|
|
|
|
117 |
$url = $api_url;
|
118 |
-
$sendSms = $this->getHelper()->sendSms($url,$
|
119 |
}
|
120 |
|
121 |
-
}
|
122 |
}
|
123 |
}
|
124 |
}
|
@@ -126,27 +152,35 @@ class Carotechs_Smsnotify_Model_Observer
|
|
126 |
public function sendSmsOnOrderCanceled(Varien_Event_Observer $observer)
|
127 |
{
|
128 |
if($this->getHelper()->isOrderCanceledEnabled()) {
|
129 |
-
$
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
133 |
$api_url = $this->getHelper()->getAPI();
|
134 |
$message_field_name = $this->getHelper()->getMessageField();
|
|
|
|
|
135 |
if($message_field_name=='')
|
136 |
{
|
137 |
-
$message_field_name = '
|
|
|
|
|
|
|
|
|
138 |
}
|
|
|
139 |
$sent_method = $this->getHelper()->getSentMethod();
|
140 |
|
141 |
-
$smsto = $this->getHelper()->getTelephoneFromOrder($order);
|
142 |
-
$smsmsg = $this->getHelper()->
|
143 |
|
144 |
-
|
145 |
-
$data .= '&'.$message_field_name.'=' . urlencode($smsmsg);
|
146 |
-
$api_url = str_replace('{{mobile_no}}',$smsto,$api_url);
|
147 |
-
|
148 |
if($sent_method)
|
149 |
{
|
|
|
|
|
|
|
|
|
150 |
$method = 'GET';
|
151 |
$url = $api_url.$data;
|
152 |
$sendSms = $this->getHelper()->sendSms($url);
|
@@ -154,11 +188,12 @@ class Carotechs_Smsnotify_Model_Observer
|
|
154 |
else
|
155 |
{
|
156 |
$method = 'POST';
|
|
|
|
|
157 |
$url = $api_url;
|
158 |
-
$sendSms = $this->getHelper()->sendSms($url,$
|
159 |
}
|
160 |
|
161 |
-
}
|
162 |
}
|
163 |
}
|
164 |
}
|
@@ -166,27 +201,35 @@ class Carotechs_Smsnotify_Model_Observer
|
|
166 |
public function sendSmsOnShipmentCreated(Varien_Event_Observer $observer)
|
167 |
{
|
168 |
if($this->getHelper()->isShipmentsEnabled()) {
|
169 |
-
$
|
170 |
-
$order =
|
|
|
171 |
if ($order instanceof Mage_Sales_Model_Order)
|
172 |
{
|
173 |
$api_url = $this->getHelper()->getAPI();
|
174 |
$message_field_name = $this->getHelper()->getMessageField();
|
|
|
|
|
175 |
if($message_field_name=='')
|
176 |
{
|
177 |
-
$message_field_name = '
|
|
|
|
|
|
|
|
|
178 |
}
|
|
|
179 |
$sent_method = $this->getHelper()->getSentMethod();
|
180 |
|
181 |
-
$smsto = $this->getHelper()->getTelephoneFromOrder($order);
|
182 |
-
$smsmsg = $this->getHelper()->
|
183 |
|
184 |
-
|
185 |
-
$data .= '&'.$message_field_name.'=' . urlencode($smsmsg);
|
186 |
-
$api_url = str_replace('{{mobile_no}}',$smsto,$api_url);
|
187 |
-
|
188 |
if($sent_method)
|
189 |
{
|
|
|
|
|
|
|
|
|
190 |
$method = 'GET';
|
191 |
$url = $api_url.$data;
|
192 |
$sendSms = $this->getHelper()->sendSms($url);
|
@@ -194,8 +237,10 @@ class Carotechs_Smsnotify_Model_Observer
|
|
194 |
else
|
195 |
{
|
196 |
$method = 'POST';
|
|
|
|
|
197 |
$url = $api_url;
|
198 |
-
$sendSms = $this->getHelper()->sendSms($url,$
|
199 |
}
|
200 |
|
201 |
}
|
3 |
{
|
4 |
public function sendSmsOnOrderCreated(Varien_Event_Observer $observer)
|
5 |
{
|
|
|
6 |
if($this->getHelper()->isOrdersEnabled())
|
7 |
{
|
8 |
$orders = $observer->getEvent()->getOrderIds();
|
9 |
$order = Mage::getModel('sales/order')->load($orders['0']);
|
10 |
+
|
11 |
if ($order instanceof Mage_Sales_Model_Order)
|
12 |
{
|
13 |
$api_url = $this->getHelper()->getAPI();
|
14 |
$message_field_name = $this->getHelper()->getMessageField();
|
15 |
+
$to_field_name = $this->getHelper()->getToField();
|
16 |
+
|
17 |
if($message_field_name=='')
|
18 |
{
|
19 |
+
$message_field_name = 'msg';
|
20 |
+
}
|
21 |
+
if($to_field_name=='')
|
22 |
+
{
|
23 |
+
$to_field_name = 'to';
|
24 |
}
|
25 |
+
|
26 |
$sent_method = $this->getHelper()->getSentMethod();
|
27 |
|
28 |
+
$smsto = urlencode($this->getHelper()->getTelephoneFromOrder($order));
|
29 |
+
$smsmsg = urlencode($this->getHelper()->getMessage($order));
|
30 |
|
|
|
|
|
|
|
|
|
31 |
if($sent_method)
|
32 |
{
|
33 |
+
$data = '';
|
34 |
+
$data .= '?'.$message_field_name.'=' . $smsmsg;
|
35 |
+
$data .= '&'.$to_field_name.'=' . $smsto;
|
36 |
+
|
37 |
$method = 'GET';
|
38 |
$url = $api_url.$data;
|
39 |
$sendSms = $this->getHelper()->sendSms($url);
|
41 |
else
|
42 |
{
|
43 |
$method = 'POST';
|
44 |
+
$post_data[$message_field_name] = $smsmsg;
|
45 |
+
$post_data[$to_field_name] = $smsto;
|
46 |
$url = $api_url;
|
47 |
+
$sendSms = $this->getHelper()->sendSms($url,$post_data);
|
48 |
}
|
49 |
|
50 |
}
|
54 |
public function sendSmsOnOrderHold(Varien_Event_Observer $observer)
|
55 |
{
|
56 |
if($this->getHelper()->isOrderHoldEnabled()) {
|
57 |
+
$orders = $observer->getEvent()->getOrderIds();
|
58 |
+
$order = Mage::getModel('sales/order')->load($orders['0']);
|
59 |
+
|
60 |
+
if ($order instanceof Mage_Sales_Model_Order)
|
61 |
+
{
|
62 |
$api_url = $this->getHelper()->getAPI();
|
63 |
$message_field_name = $this->getHelper()->getMessageField();
|
64 |
+
$to_field_name = $this->getHelper()->getToField();
|
65 |
+
|
66 |
if($message_field_name=='')
|
67 |
{
|
68 |
+
$message_field_name = 'msg';
|
69 |
}
|
70 |
+
if($to_field_name=='')
|
71 |
+
{
|
72 |
+
$to_field_name = 'to';
|
73 |
+
}
|
74 |
+
|
75 |
$sent_method = $this->getHelper()->getSentMethod();
|
76 |
|
77 |
+
$smsto = urlencode($this->getHelper()->getTelephoneFromOrder($order));
|
78 |
+
$smsmsg = urlencode($this->getHelper()->getSenderForOrderHold($order));
|
79 |
|
|
|
|
|
|
|
|
|
80 |
if($sent_method)
|
81 |
{
|
82 |
+
$data = '';
|
83 |
+
$data .= '?'.$message_field_name.'=' . $smsmsg;
|
84 |
+
$data .= '&'.$to_field_name.'=' . $smsto;
|
85 |
+
|
86 |
$method = 'GET';
|
87 |
$url = $api_url.$data;
|
88 |
$sendSms = $this->getHelper()->sendSms($url);
|
90 |
else
|
91 |
{
|
92 |
$method = 'POST';
|
93 |
+
$post_data[$message_field_name] = $smsmsg;
|
94 |
+
$post_data[$to_field_name] = $smsto;
|
95 |
$url = $api_url;
|
96 |
+
$sendSms = $this->getHelper()->sendSms($url,$post_data);
|
97 |
}
|
98 |
|
|
|
|
|
99 |
}
|
100 |
}
|
101 |
}
|
103 |
public function sendSmsOnOrderUnhold(Varien_Event_Observer $observer)
|
104 |
{
|
105 |
if($this->getHelper()->isOrderUnholdEnabled()) {
|
106 |
+
$orders = $observer->getEvent()->getOrderIds();
|
107 |
+
$order = Mage::getModel('sales/order')->load($orders['0']);
|
108 |
+
|
109 |
+
if ($order instanceof Mage_Sales_Model_Order)
|
110 |
+
{
|
111 |
$api_url = $this->getHelper()->getAPI();
|
112 |
$message_field_name = $this->getHelper()->getMessageField();
|
113 |
+
$to_field_name = $this->getHelper()->getToField();
|
114 |
+
|
115 |
if($message_field_name=='')
|
116 |
{
|
117 |
+
$message_field_name = 'msg';
|
118 |
}
|
119 |
+
if($to_field_name=='')
|
120 |
+
{
|
121 |
+
$to_field_name = 'to';
|
122 |
+
}
|
123 |
+
|
124 |
$sent_method = $this->getHelper()->getSentMethod();
|
125 |
|
126 |
+
$smsto = urlencode($this->getHelper()->getTelephoneFromOrder($order));
|
127 |
+
$smsmsg = urlencode($this->getHelper()->getSenderForOrderUnHold($order));
|
128 |
|
|
|
|
|
|
|
|
|
129 |
if($sent_method)
|
130 |
{
|
131 |
+
$data = '';
|
132 |
+
$data .= '?'.$message_field_name.'=' . $smsmsg;
|
133 |
+
$data .= '&'.$to_field_name.'=' . $smsto;
|
134 |
+
|
135 |
$method = 'GET';
|
136 |
$url = $api_url.$data;
|
137 |
$sendSms = $this->getHelper()->sendSms($url);
|
139 |
else
|
140 |
{
|
141 |
$method = 'POST';
|
142 |
+
$post_data[$message_field_name] = $smsmsg;
|
143 |
+
$post_data[$to_field_name] = $smsto;
|
144 |
$url = $api_url;
|
145 |
+
$sendSms = $this->getHelper()->sendSms($url,$post_data);
|
146 |
}
|
147 |
|
|
|
148 |
}
|
149 |
}
|
150 |
}
|
152 |
public function sendSmsOnOrderCanceled(Varien_Event_Observer $observer)
|
153 |
{
|
154 |
if($this->getHelper()->isOrderCanceledEnabled()) {
|
155 |
+
$orders = $observer->getEvent()->getOrderIds();
|
156 |
+
$order = Mage::getModel('sales/order')->load($orders['0']);
|
157 |
+
|
158 |
+
if ($order instanceof Mage_Sales_Model_Order)
|
159 |
+
{
|
160 |
$api_url = $this->getHelper()->getAPI();
|
161 |
$message_field_name = $this->getHelper()->getMessageField();
|
162 |
+
$to_field_name = $this->getHelper()->getToField();
|
163 |
+
|
164 |
if($message_field_name=='')
|
165 |
{
|
166 |
+
$message_field_name = 'msg';
|
167 |
+
}
|
168 |
+
if($to_field_name=='')
|
169 |
+
{
|
170 |
+
$to_field_name = 'to';
|
171 |
}
|
172 |
+
|
173 |
$sent_method = $this->getHelper()->getSentMethod();
|
174 |
|
175 |
+
$smsto = urlencode($this->getHelper()->getTelephoneFromOrder($order));
|
176 |
+
$smsmsg = urlencode($this->getHelper()->getSenderForOrderCanceled($order));
|
177 |
|
|
|
|
|
|
|
|
|
178 |
if($sent_method)
|
179 |
{
|
180 |
+
$data = '';
|
181 |
+
$data .= '?'.$message_field_name.'=' . $smsmsg;
|
182 |
+
$data .= '&'.$to_field_name.'=' . $smsto;
|
183 |
+
|
184 |
$method = 'GET';
|
185 |
$url = $api_url.$data;
|
186 |
$sendSms = $this->getHelper()->sendSms($url);
|
188 |
else
|
189 |
{
|
190 |
$method = 'POST';
|
191 |
+
$post_data[$message_field_name] = $smsmsg;
|
192 |
+
$post_data[$to_field_name] = $smsto;
|
193 |
$url = $api_url;
|
194 |
+
$sendSms = $this->getHelper()->sendSms($url,$post_data);
|
195 |
}
|
196 |
|
|
|
197 |
}
|
198 |
}
|
199 |
}
|
201 |
public function sendSmsOnShipmentCreated(Varien_Event_Observer $observer)
|
202 |
{
|
203 |
if($this->getHelper()->isShipmentsEnabled()) {
|
204 |
+
$orders = $observer->getEvent()->getOrderIds();
|
205 |
+
$order = Mage::getModel('sales/order')->load($orders['0']);
|
206 |
+
|
207 |
if ($order instanceof Mage_Sales_Model_Order)
|
208 |
{
|
209 |
$api_url = $this->getHelper()->getAPI();
|
210 |
$message_field_name = $this->getHelper()->getMessageField();
|
211 |
+
$to_field_name = $this->getHelper()->getToField();
|
212 |
+
|
213 |
if($message_field_name=='')
|
214 |
{
|
215 |
+
$message_field_name = 'msg';
|
216 |
+
}
|
217 |
+
if($to_field_name=='')
|
218 |
+
{
|
219 |
+
$to_field_name = 'to';
|
220 |
}
|
221 |
+
|
222 |
$sent_method = $this->getHelper()->getSentMethod();
|
223 |
|
224 |
+
$smsto = urlencode($this->getHelper()->getTelephoneFromOrder($order));
|
225 |
+
$smsmsg = urlencode($this->getHelper()->getSenderForShipment($order));
|
226 |
|
|
|
|
|
|
|
|
|
227 |
if($sent_method)
|
228 |
{
|
229 |
+
$data = '';
|
230 |
+
$data .= '?'.$message_field_name.'=' . $smsmsg;
|
231 |
+
$data .= '&'.$to_field_name.'=' . $smsto;
|
232 |
+
|
233 |
$method = 'GET';
|
234 |
$url = $api_url.$data;
|
235 |
$sendSms = $this->getHelper()->sendSms($url);
|
237 |
else
|
238 |
{
|
239 |
$method = 'POST';
|
240 |
+
$post_data[$message_field_name] = $smsmsg;
|
241 |
+
$post_data[$to_field_name] = $smsto;
|
242 |
$url = $api_url;
|
243 |
+
$sendSms = $this->getHelper()->sendSms($url,$post_data);
|
244 |
}
|
245 |
|
246 |
}
|
app/code/local/Carotechs/Smsnotify/etc/config.xml
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
<config>
|
10 |
<modules>
|
11 |
<Carotechs_Smsnotify>
|
12 |
-
<version>0.1.
|
13 |
</Carotechs_Smsnotify>
|
14 |
</modules>
|
15 |
|
@@ -44,11 +44,13 @@
|
|
44 |
</smsnotify>
|
45 |
</models>
|
46 |
|
|
|
47 |
<helpers>
|
48 |
<smsnotify>
|
49 |
<class>Carotechs_Smsnotify_Helper</class>
|
50 |
</smsnotify>
|
51 |
</helpers>
|
|
|
52 |
<events>
|
53 |
<checkout_onepage_controller_success_action>
|
54 |
<observers>
|
@@ -94,35 +96,37 @@
|
|
94 |
<default>
|
95 |
<smsnotify>
|
96 |
<general>
|
97 |
-
<api>
|
98 |
<urlmethod>1</urlmethod>
|
99 |
-
<message_field>
|
|
|
100 |
</general>
|
|
|
101 |
<orders>
|
102 |
<enabled>0</enabled>
|
103 |
<sender>Magento</sender>
|
104 |
-
<message>
|
105 |
<notify>0</notify>
|
106 |
</orders>
|
107 |
<order_hold>
|
108 |
<enabled>0</enabled>
|
109 |
<sender>Magento</sender>
|
110 |
-
<message>
|
111 |
</order_hold>
|
112 |
<order_unhold>
|
113 |
<enabled>0</enabled>
|
114 |
<sender>Magento</sender>
|
115 |
-
<message>
|
116 |
</order_unhold>
|
117 |
<order_canceled>
|
118 |
<enabled>0</enabled>
|
119 |
<sender>Magento</sender>
|
120 |
-
<message>
|
121 |
</order_canceled>
|
122 |
<shipments>
|
123 |
<enabled>0</enabled>
|
124 |
<sender>Magento</sender>
|
125 |
-
<message>
|
126 |
</shipments>
|
127 |
</smsnotify>
|
128 |
</default>
|
9 |
<config>
|
10 |
<modules>
|
11 |
<Carotechs_Smsnotify>
|
12 |
+
<version>0.1.3</version>
|
13 |
</Carotechs_Smsnotify>
|
14 |
</modules>
|
15 |
|
44 |
</smsnotify>
|
45 |
</models>
|
46 |
|
47 |
+
|
48 |
<helpers>
|
49 |
<smsnotify>
|
50 |
<class>Carotechs_Smsnotify_Helper</class>
|
51 |
</smsnotify>
|
52 |
</helpers>
|
53 |
+
|
54 |
<events>
|
55 |
<checkout_onepage_controller_success_action>
|
56 |
<observers>
|
96 |
<default>
|
97 |
<smsnotify>
|
98 |
<general>
|
99 |
+
<api>http://www.yoursmsgateway.com/send.php</api>
|
100 |
<urlmethod>1</urlmethod>
|
101 |
+
<message_field>text</message_field>
|
102 |
+
<to_field>to</to_field>
|
103 |
</general>
|
104 |
+
|
105 |
<orders>
|
106 |
<enabled>0</enabled>
|
107 |
<sender>Magento</sender>
|
108 |
+
<message>Dear {{firstname}}, Your order has been received. Order no. {{order_id}}. Thank you for your purchase!</message>
|
109 |
<notify>0</notify>
|
110 |
</orders>
|
111 |
<order_hold>
|
112 |
<enabled>0</enabled>
|
113 |
<sender>Magento</sender>
|
114 |
+
<message>Dear {{firstname}}, Your order {{order_id}} has been placed on hold.</message>
|
115 |
</order_hold>
|
116 |
<order_unhold>
|
117 |
<enabled>0</enabled>
|
118 |
<sender>Magento</sender>
|
119 |
+
<message>Dear {{firstname}}, Your order {{order_id}} has been released for delivery.</message>
|
120 |
</order_unhold>
|
121 |
<order_canceled>
|
122 |
<enabled>0</enabled>
|
123 |
<sender>Magento</sender>
|
124 |
+
<message>Dear {{firstname}}, Your order {{order_id}} has been canceled.</message>
|
125 |
</order_canceled>
|
126 |
<shipments>
|
127 |
<enabled>0</enabled>
|
128 |
<sender>Magento</sender>
|
129 |
+
<message>Dear {{firstname}}. Your order ({{order_id}}) has been shipped. Thank you for buying from us!</message>
|
130 |
</shipments>
|
131 |
</smsnotify>
|
132 |
</default>
|
app/code/local/Carotechs/Smsnotify/etc/system.xml
CHANGED
@@ -24,9 +24,12 @@
|
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>1</show_in_store>
|
26 |
<fields>
|
|
|
|
|
|
|
27 |
<api translate="label">
|
28 |
-
<label>SMS Gateway URL</label>
|
29 |
-
<comment>
|
30 |
<frontend_type>text</frontend_type>
|
31 |
<sort_order>1</sort_order>
|
32 |
<show_in_default>1</show_in_default>
|
@@ -42,15 +45,50 @@
|
|
42 |
<show_in_website>1</show_in_website>
|
43 |
<show_in_store>1</show_in_store>
|
44 |
</urlmethod>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
<message_field translate="label">
|
46 |
-
<label>Message
|
47 |
<comment>(ie., msg=your message)</comment>
|
48 |
<frontend_type>text</frontend_type>
|
49 |
-
<sort_order>
|
50 |
<show_in_default>1</show_in_default>
|
51 |
<show_in_website>1</show_in_website>
|
52 |
<show_in_store>1</show_in_store>
|
53 |
</message_field>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
</fields>
|
55 |
</general>
|
56 |
|
@@ -76,7 +114,7 @@
|
|
76 |
|
77 |
<message translate="label comment">
|
78 |
<label>Message</label>
|
79 |
-
<comment>
|
80 |
<tooltip>{{firstname}} = First Name</tooltip>
|
81 |
<validate>required-entry</validate>
|
82 |
<frontend_type>textarea</frontend_type>
|
@@ -109,7 +147,7 @@
|
|
109 |
|
110 |
<message translate="label comment">
|
111 |
<label>Message</label>
|
112 |
-
<comment>
|
113 |
<tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
|
114 |
<validate>required-entry</validate>
|
115 |
<frontend_type>textarea</frontend_type>
|
@@ -141,7 +179,7 @@
|
|
141 |
|
142 |
<message translate="label comment">
|
143 |
<label>Message</label>
|
144 |
-
<comment>
|
145 |
<tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
|
146 |
<validate>required-entry</validate>
|
147 |
<frontend_type>textarea</frontend_type>
|
@@ -173,7 +211,7 @@
|
|
173 |
|
174 |
<message translate="label comment">
|
175 |
<label>Message</label>
|
176 |
-
<comment>
|
177 |
<tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
|
178 |
<validate>required-entry</validate>
|
179 |
<frontend_type>textarea</frontend_type>
|
@@ -205,7 +243,7 @@
|
|
205 |
|
206 |
<message translate="label comment">
|
207 |
<label>Message</label>
|
208 |
-
<comment>
|
209 |
<tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
|
210 |
<validate>required-entry</validate>
|
211 |
<frontend_type>textarea</frontend_type>
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>1</show_in_store>
|
26 |
<fields>
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
<api translate="label">
|
31 |
+
<label>SMS Gateway API URL</label>
|
32 |
+
<comment>Include all parameters in the API except message and customer phone number parameters.</comment>
|
33 |
<frontend_type>text</frontend_type>
|
34 |
<sort_order>1</sort_order>
|
35 |
<show_in_default>1</show_in_default>
|
45 |
<show_in_website>1</show_in_website>
|
46 |
<show_in_store>1</show_in_store>
|
47 |
</urlmethod>
|
48 |
+
|
49 |
+
<paraminfo translate="label, comment">
|
50 |
+
<frontend_type>label</frontend_type>
|
51 |
+
<frontend_class>title_label</frontend_class>
|
52 |
+
<label>URL Parameters</label>
|
53 |
+
<sort_order>3</sort_order>
|
54 |
+
<show_in_default>1</show_in_default>
|
55 |
+
<show_in_website>1</show_in_website>
|
56 |
+
<show_in_store>1</show_in_store>
|
57 |
+
</paraminfo>
|
58 |
+
|
59 |
<message_field translate="label">
|
60 |
+
<label>Message parameter name</label>
|
61 |
<comment>(ie., msg=your message)</comment>
|
62 |
<frontend_type>text</frontend_type>
|
63 |
+
<sort_order>4</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 |
</message_field>
|
68 |
+
|
69 |
+
<to_field translate="label">
|
70 |
+
<label>To Number - Parameter Name</label>
|
71 |
+
<comment>Make sure that you capture the customer mobile phone number with the valid format during registration
|
72 |
+
or check out.</comment>
|
73 |
+
<frontend_type>text</frontend_type>
|
74 |
+
<sort_order>5</sort_order>
|
75 |
+
<show_in_default>1</show_in_default>
|
76 |
+
<show_in_website>1</show_in_website>
|
77 |
+
<show_in_store>1</show_in_store>
|
78 |
+
</to_field>
|
79 |
+
|
80 |
+
<configinfo translate="label">
|
81 |
+
<frontend_type>label</frontend_type>
|
82 |
+
<label>Sample API URL format:</label>
|
83 |
+
<comment><![CDATA[http://www.yoursmsgateway.com/send.php?user={{user}}&password={{pass}}&api_id=YOUR_API_ID&to={{phone_number}}&text={{text_message}}<br/><b>Make sure that this URL format matches gateway api url.]]></comment>
|
84 |
+
<sort_order>6</sort_order>
|
85 |
+
<show_in_default>1</show_in_default>
|
86 |
+
<show_in_website>0</show_in_website>
|
87 |
+
<show_in_store>0</show_in_store>
|
88 |
+
</configinfo>
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
</fields>
|
93 |
</general>
|
94 |
|
114 |
|
115 |
<message translate="label comment">
|
116 |
<label>Message</label>
|
117 |
+
<comment>Please enter the message you like to send. Use {{firstname}} to replace with the Customer's First Name in the Order and {{order_id}} to replace with Order No. in the message.</comment>
|
118 |
<tooltip>{{firstname}} = First Name</tooltip>
|
119 |
<validate>required-entry</validate>
|
120 |
<frontend_type>textarea</frontend_type>
|
147 |
|
148 |
<message translate="label comment">
|
149 |
<label>Message</label>
|
150 |
+
<comment>Please enter the message you like to send. Use {{firstname}} to replace with the Customer's First Name in the Order and {{order_id}} to replace with Order No. in the message.</comment>
|
151 |
<tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
|
152 |
<validate>required-entry</validate>
|
153 |
<frontend_type>textarea</frontend_type>
|
179 |
|
180 |
<message translate="label comment">
|
181 |
<label>Message</label>
|
182 |
+
<comment>Please enter the message you like to send. Use {{firstname}} to replace with the Customer's First Name in the Order and {{order_id}} to replace with Order No. in the message.</comment>
|
183 |
<tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
|
184 |
<validate>required-entry</validate>
|
185 |
<frontend_type>textarea</frontend_type>
|
211 |
|
212 |
<message translate="label comment">
|
213 |
<label>Message</label>
|
214 |
+
<comment>Please enter the message you like to send. Use {{firstname}} to replace with the Customer's First Name in the Order and {{order_id}} to replace with Order No. in the message.</comment>
|
215 |
<tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
|
216 |
<validate>required-entry</validate>
|
217 |
<frontend_type>textarea</frontend_type>
|
243 |
|
244 |
<message translate="label comment">
|
245 |
<label>Message</label>
|
246 |
+
<comment>Please enter the message you like to send. Use {{firstname}} to replace with the Customer's First Name in the Order and {{order_id}} to replace with Order No. in the message.</comment>
|
247 |
<tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
|
248 |
<validate>required-entry</validate>
|
249 |
<frontend_type>textarea</frontend_type>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Carotechs_Smsnotify</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSLv3.0</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>SMS notification</description>
|
11 |
<notes>SMS notification</notes>
|
12 |
<authors><author><name>carotechs</name><user>carotechs</user><email>apps@carotechs.com</email></author></authors>
|
13 |
-
<date>2014-12-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magelocal"><dir name="Carotechs"><dir name="Smsnotify"><dir name="Helper"><file name="Data.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Carotechs_Smsnotify</name>
|
4 |
+
<version>0.1.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSLv3.0</license>
|
7 |
<channel>community</channel>
|
10 |
<description>SMS notification</description>
|
11 |
<notes>SMS notification</notes>
|
12 |
<authors><author><name>carotechs</name><user>carotechs</user><email>apps@carotechs.com</email></author></authors>
|
13 |
+
<date>2014-12-17</date>
|
14 |
+
<time>11:07:20</time>
|
15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Carotechs_Smsnotify.xml" hash="cbc54fef2beda0afca8e70da6b1cb64e"/></dir></target><target name="magelocal"><dir name="Carotechs"><dir name="Smsnotify"><dir name="Helper"><file name="Data.php" hash="02cf80e3fc5cdbe9f7db8ea492dcf2bb"/></dir><dir name="Model"><dir name="Dropdown"><file name="Values.php" hash="c4b45a94203c6d01ad5c68254e9a47ef"/></dir><file name="Observer.php" hash="a9f4081ec47a2bf0e70ce73df7a23498"/></dir><dir name="etc"><file name="adminhtml.xml" hash="630a24f98f8d22583a25c1038663ec48"/><file name="config.xml" hash="692711636e872c469e9a882b6aa4c54d"/><file name="system.xml" hash="264f6be93060b3c9624af49cff3cac45"/></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|