Version Notes
SMSAPI SMS v 0.1.1
Some little fixes.
Download this release
Release Info
Developer | Marek Jasiukiewicz |
Extension | Smsapi_Sms |
Version | 0.1.1 |
Comparing to | |
See all releases |
Code changes from version 0.1.0 to 0.1.1
- app/code/community/Smsapi/Sms/Model/Observer.php +21 -11
- app/code/community/Smsapi/Sms/etc/config.xml +1 -1
- app/code/community/Smsapi/Sms/etc/system.xml +1 -1
- app/design/adminhtml/base/default/template/sms/system/config/fieldset/branding.phtml +2 -1
- app/locale/pl_PL/Smsapi_Sms.csv +73 -36
- package.xml +8 -7
app/code/community/Smsapi/Sms/Model/Observer.php
CHANGED
@@ -23,6 +23,8 @@ class Smsapi_Sms_Model_Observer {
|
|
23 |
if ($config->isApiEnabled()==0) return; //do nothing if api is disabled
|
24 |
|
25 |
$order = $observer->getEvent()->getOrder();
|
|
|
|
|
26 |
$newStatus = $order->getData('status');
|
27 |
$origStatus = $order->getOrigData('status');
|
28 |
|
@@ -45,24 +47,31 @@ class Smsapi_Sms_Model_Observer {
|
|
45 |
else
|
46 |
$last_tracking_number = 'no_tracking'; //if no tracking number set "no_tracking" message for {TRACKINGNUMBER} template
|
47 |
|
|
|
|
|
|
|
|
|
48 |
|
49 |
-
//getting order data to generate message template
|
50 |
-
$messageOrderData['{NAME}'] = $order->getShippingAddress()->getData('firstname');
|
51 |
-
$messageOrderData['{ORDERNUMBER}'] = $order->getIncrement_id();
|
52 |
-
$messageOrderData['{ORDERSTATUS}'] = $newStatus;
|
53 |
-
$messageOrderData['{TRACKINGNUMBER}'] = $last_tracking_number;
|
54 |
-
$messageOrderData['{STORENAME}'] = $config->getApiStoreName();
|
55 |
-
|
56 |
-
$message = strtr($message,$messageOrderData);
|
57 |
-
|
58 |
|
59 |
try { //try to send message
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
$api = Mage::getModel('sms/apiClient');
|
62 |
$api->connect();
|
63 |
|
64 |
//prepare sms content
|
65 |
-
$msg['recipient'] = $
|
66 |
$msg['message'] = $message;
|
67 |
$msg['eco'] = $config->isEco(); //eco version - without sender
|
68 |
$msg['test'] = $config->testMode();
|
@@ -73,6 +82,7 @@ class Smsapi_Sms_Model_Observer {
|
|
73 |
//sending sms and getting API response
|
74 |
|
75 |
try {
|
|
|
76 |
$response = $api->msgContent($msg)->send();
|
77 |
$newComment = Mage::helper('sms')->__('SMS notification sent (SMS id:').$response->response[0]->id.') ' ;
|
78 |
$order->addStatusToHistory($order->getStatus(),$newComment,true);
|
23 |
if ($config->isApiEnabled()==0) return; //do nothing if api is disabled
|
24 |
|
25 |
$order = $observer->getEvent()->getOrder();
|
26 |
+
|
27 |
+
|
28 |
$newStatus = $order->getData('status');
|
29 |
$origStatus = $order->getOrigData('status');
|
30 |
|
47 |
else
|
48 |
$last_tracking_number = 'no_tracking'; //if no tracking number set "no_tracking" message for {TRACKINGNUMBER} template
|
49 |
|
50 |
+
|
51 |
+
$address = $order->getShippingAddress();
|
52 |
+
if (!$address)
|
53 |
+
$address = $order->getBillingAddress();
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
try { //try to send message
|
57 |
+
|
58 |
+
|
59 |
+
//getting order data to generate message template
|
60 |
+
$messageOrderData['{NAME}'] = $address->getData('firstname');
|
61 |
+
$messageOrderData['{ORDERNUMBER}'] = $order->getIncrement_id();
|
62 |
+
$messageOrderData['{ORDERSTATUS}'] = $newStatus;
|
63 |
+
$messageOrderData['{TRACKINGNUMBER}'] = $last_tracking_number;
|
64 |
+
$messageOrderData['{STORENAME}'] = $config->getApiStoreName();
|
65 |
+
|
66 |
+
$message = strtr($message,$messageOrderData);
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
$api = Mage::getModel('sms/apiClient');
|
71 |
$api->connect();
|
72 |
|
73 |
//prepare sms content
|
74 |
+
$msg['recipient'] = $address->getData('telephone'); //or getBillingAddress
|
75 |
$msg['message'] = $message;
|
76 |
$msg['eco'] = $config->isEco(); //eco version - without sender
|
77 |
$msg['test'] = $config->testMode();
|
82 |
//sending sms and getting API response
|
83 |
|
84 |
try {
|
85 |
+
|
86 |
$response = $api->msgContent($msg)->send();
|
87 |
$newComment = Mage::helper('sms')->__('SMS notification sent (SMS id:').$response->response[0]->id.') ' ;
|
88 |
$order->addStatusToHistory($order->getStatus(),$newComment,true);
|
app/code/community/Smsapi/Sms/etc/config.xml
CHANGED
@@ -35,7 +35,7 @@
|
|
35 |
|
36 |
<modules>
|
37 |
<Smsapi_Sms>
|
38 |
-
<version>0.1.
|
39 |
</Smsapi_Sms>
|
40 |
</modules>
|
41 |
|
35 |
|
36 |
<modules>
|
37 |
<Smsapi_Sms>
|
38 |
+
<version>0.1.1</version>
|
39 |
</Smsapi_Sms>
|
40 |
</modules>
|
41 |
|
app/code/community/Smsapi/Sms/etc/system.xml
CHANGED
@@ -47,7 +47,7 @@
|
|
47 |
<show_in_website>1</show_in_website>
|
48 |
<show_in_store>1</show_in_store>
|
49 |
<groups>
|
50 |
-
<branding_header translate="label" module="
|
51 |
<frontend_model>sms/adminhtml_system_config_fieldset_branding</frontend_model>
|
52 |
<sort_order>0</sort_order>
|
53 |
<show_in_default>1</show_in_default>
|
47 |
<show_in_website>1</show_in_website>
|
48 |
<show_in_store>1</show_in_store>
|
49 |
<groups>
|
50 |
+
<branding_header translate="label" module="sms">
|
51 |
<frontend_model>sms/adminhtml_system_config_fieldset_branding</frontend_model>
|
52 |
<sort_order>0</sort_order>
|
53 |
<show_in_default>1</show_in_default>
|
app/design/adminhtml/base/default/template/sms/system/config/fieldset/branding.phtml
CHANGED
@@ -4,4 +4,5 @@
|
|
4 |
.content-header { margin-bottom: 0px !important; }
|
5 |
|
6 |
</style>
|
7 |
-
<div style="overflow: hidden;"><img src="<?php echo $this->getSkinUrl('images/smsapi/sms/smsapi_logo.jpg'); ?>"></div>
|
|
4 |
.content-header { margin-bottom: 0px !important; }
|
5 |
|
6 |
</style>
|
7 |
+
<div style="overflow: hidden;"><img src="<?php echo $this->getSkinUrl('images/smsapi/sms/smsapi_logo.jpg'); ?>"></div>
|
8 |
+
<div class="comment"><?php echo Mage::helper('sms')->__('SMSAPI Module for Magento-based stores enables automatic send SMS notifications to customers. SMS communication has many benefits including facilitates communication with your customers and speeds up reaching the details of the order. Short text messages are sent primarily as information on the status of the order, such as a message confirming the correct course of a transaction or message about delivery time of orders. SMS is fastest communication with your customers, and savings for the company due to reduced costs associated with undelivered shipments. SMS notifications in Magento module can be sent from the field in active sender SMSAPI account. Content templates are fully editable.'); ?></div>
|
app/locale/pl_PL/Smsapi_Sms.csv
CHANGED
@@ -1,36 +1,73 @@
|
|
1 |
-
"Main Configuration","SMS API - konfiguracja podstawowa"
|
2 |
-
|
3 |
-
"
|
4 |
-
|
5 |
-
"
|
6 |
-
|
7 |
-
"
|
8 |
-
|
9 |
-
"
|
10 |
-
|
11 |
-
"
|
12 |
-
|
13 |
-
"
|
14 |
-
|
15 |
-
"
|
16 |
-
|
17 |
-
"
|
18 |
-
|
19 |
-
"
|
20 |
-
|
21 |
-
"
|
22 |
-
|
23 |
-
"
|
24 |
-
|
25 |
-
"
|
26 |
-
|
27 |
-
"
|
28 |
-
|
29 |
-
"SMS
|
30 |
-
|
31 |
-
"
|
32 |
-
|
33 |
-
"
|
34 |
-
|
35 |
-
"
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Main Configuration","SMS API - konfiguracja podstawowa"
|
2 |
+
|
3 |
+
"Enabled","Włączone"
|
4 |
+
|
5 |
+
"API Login","API - login"
|
6 |
+
|
7 |
+
"API Password","API - hasło"
|
8 |
+
|
9 |
+
"Store name","Nazwa sklepu"
|
10 |
+
|
11 |
+
"SMS Sender","Nadawca SMS"
|
12 |
+
|
13 |
+
"Allow long messages (more than 160 chars)","Zezwalaj na kilkuczęściowe SMSy (dłuższe niż 160 znaków)"
|
14 |
+
|
15 |
+
"Message templates","Szablony wiadomości"
|
16 |
+
|
17 |
+
"Template","Szablon"
|
18 |
+
|
19 |
+
"Send SMS after status changed to ""Pending Payment""","Wyślij SMS-a po zmianie statusu na ""Pending Payment/Oczekuje na płatność"""
|
20 |
+
|
21 |
+
"Send SMS after status changed to ""On Hold""","Wyślij SMS-a po zmianie statusu na ""On Hold/Wstrzymano"""
|
22 |
+
|
23 |
+
"Send SMS after status changed to ""Canceled""","Wyślij SMS-a po zmianie statusu na ""Canceled/Anulowane"""
|
24 |
+
|
25 |
+
"Send SMS after status changed to ""Complete""","Wyślij SMS-a po zmianie statusu na ""Complete/Zakończone"""
|
26 |
+
|
27 |
+
"Send SMS after status changed to ""Closed""","Wyślij SMS-a po zmianie statusu na ""Closed/Zamknięty"""
|
28 |
+
|
29 |
+
"Send SMS after status changed to ""Processing""","Wyślij SMS-a po zmianie statusu na ""Processing/Przetwarzam"""
|
30 |
+
|
31 |
+
"To add new SMS Sender go to ""http://www.sms.pl"" -> (left menu) USTAWIENIA -> POLA NADAWCY","Aby dodać nowe pole nadawcy, zaloguj się do Panelu SMSAPI na stronie: ""http://www.smsapi.pl"" -> (lewe menu) USTAWIENIA -> POLA NADAWCY"
|
32 |
+
|
33 |
+
"Pending Payment","Oczekuje na płatność"
|
34 |
+
|
35 |
+
"On Hold","Wstrzymano"
|
36 |
+
|
37 |
+
"Canceled","Anulowane"
|
38 |
+
|
39 |
+
"Complete","Zakończone"
|
40 |
+
|
41 |
+
"Closed","Zamknięty"
|
42 |
+
|
43 |
+
"Processing","Przetwarzam"
|
44 |
+
|
45 |
+
"Use ECO SMS (cheaper version without sender)","SMS Ekonomiczny (tańsza wersja bez nadawcy)"
|
46 |
+
|
47 |
+
"Notify if my SMSAPI account points is below:","Informuj mnie jeśli ilość punktów na koncie SMSAPI spadnie poniżej: (0 - powiadomienie wyłączone)"
|
48 |
+
|
49 |
+
"0 - turn off/no alert","0 - wyłącz/bez powiadomienia"
|
50 |
+
|
51 |
+
"Warning: Low points level at your SMSAPI account. Buy credit.","Ostrzeżenie: Niski stan punktów na Twoim koncie SMSAPI. Doładuj konto."
|
52 |
+
|
53 |
+
"<div style=""padding:10px;background-color:#fff;border:1px solid #CCC;margin-bottom:7px;"">In each template you can use dynamic data. You can add <br />- {NAME} - customer name <br />- {ORDERSTATUS} - status of an order <br />- {ORDERNUMBER} - order number<br />- {TRACKINGNUMBER} - tracking number (if exists)<br />- {STORENAME} - the name of the store<br />Example: Your order #{ORDERNUMBER} waits for a fee. Regards {STORENAME}<br />SMS Content: Your order #100000012 waits for a fee. Regards smsapi.pl</div><div id=""counterContainer"">Message length: <span id=""counter"">0</span> chars.<br /> <span id=""toolongalert""> Warning: The template can be to long for 1 SMS. Please shorten the message or allow to send long messages in Main Configuration.</span></div><br />","<div style=""padding:10px;background-color:#fff;border:1px solid #CCC;margin-bottom:7px;""> <p>W każdym szablonie możesz używać danych dynamicznych. Możesz dodać:<br /> - {NAME} - imię klienta <br /> - {ORDERSTATUS} - status przesyłki <br /> - {ORDERNUMBER} - nr zamówienia<br /> - {TRACKINGNUMBER} - nr pozwalający na śledzenie przesyłki (jeśli istnieje)<br /> - {STORENAME} - nazwa sklepu<br /> Przykład: Twoje zamówienie nr {ORDERNUMBER} czeka na wpłatę. Pozdrawiamy {STORENAME}.<br /> Treść wysłanego SMSa: Twoje zamówienie nr 100000012 czeka na wpłatę. Pozdrawiamy smsapi.pl.</p></div><div id=""counterContainer"">Długość wiadomości: <span id=""counter"">0</span> znaków.<br /> <span id=""toolongalert""> Ostrzeżenie: Wiadomość zawarta w szablonie może być zbyt długa na pojedynczą wiadomość SMS. Proszę skrócić wiadomość lub zezwolić na wysyłanie długich wiadomości SMS w konfiguracji podstawowej.</span></div><br />"
|
54 |
+
|
55 |
+
"SMS notification sent (SMS id:","Wysłano SMS z powiadomieniem (id SMS-a:"
|
56 |
+
|
57 |
+
"SMS notification sending error: ""","Błąd podczas wysyłania SMS-a z powiadomieniem. Treść błędu: """
|
58 |
+
|
59 |
+
"In test mode. API working like in normal mode (sending errors, checking sent data etc.) whithout SMS sending.","W trybie testowym, API działa normalnie (odbiera błędy, sprawdza wysłane dane itp.) jednak nie wysyła SMS-a"
|
60 |
+
|
61 |
+
"Test configuration","Konfiguracja testowa"
|
62 |
+
|
63 |
+
"Turn on ""Test mode""","Włącz tryb testowy"
|
64 |
+
|
65 |
+
"Failed to send SMS notification. Please configure Your SMS API","Nie udało się wysłać powiadomienia SMS. Proszę poprawnie skonfigurować API"
|
66 |
+
|
67 |
+
"SMSAPI: Wrong Password and/or Username","SMS API: Nieprawidłowa nazwa użytkownika lub hasło."
|
68 |
+
|
69 |
+
"Registration","Rejestracja"
|
70 |
+
|
71 |
+
"Open registration form","Otwórz formularz rejestracyjny"
|
72 |
+
|
73 |
+
"SMSAPI Module for Magento-based stores enables automatic send SMS notifications to customers. SMS communication has many benefits including facilitates communication with your customers and speeds up reaching the details of the order. Short text messages are sent primarily as information on the status of the order, such as a message confirming the correct course of a transaction or message about delivery time of orders. SMS is fastest communication with your customers, and savings for the company due to reduced costs associated with undelivered shipments. SMS notifications in Magento module can be sent from the field in active sender SMSAPI account. Content templates are fully editable.","Moduł SMSAPI dla sklepów opartych na Magento umożliwia automatyczne wysyłanie powiadomień SMS w sklepie. Komunikacja SMS daje wiele korzyści między innymi usprawnia komunikację z e-klientami oraz przyspiesza dotarcie informacji dotyczących zamówienia. Krótkie wiadomości tekstowe wysyłane są przede wszystkim jako informacje o statusie realizacji zamówienia, np. jako wiadomość potwierdzająca poprawny przebieg transakcji czy wiadomość o czasie dostarczenia zamówienia pod wskazany adres. Powiadomienia SMS to zarówno szybsza komunikacja z e-klientami, jak i oszczędność dla przedsiębiorstwa ze względu na ograniczenie kosztów związanych z niedostraczonymi przesyłkami. Powiadomienia SMS w module Magento mogą być wysyłane z pola nadawcy aktywnego w koncie SMSAPI. Szablony treści są w pełni edytowalne."
|
package.xml
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Smsapi_Sms</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license>SMSAPI licence</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>SMSAPI SMS
|
10 |
-
<description>SMSAPI SMS module
|
11 |
-
<notes>SMSAPI SMS v 0.1.
|
|
|
12 |
<authors><author><name>Marek Jasiukiewicz</name><user>jasiukiewicz_m</user><email>dev@jasiukiewicz.pl</email></author><author><name>Snowdog</name><user>snowdog</user><email>support@snowdog.pl</email></author><author><name>SMSAPI</name><user>smsapi</user><email>info@smsapi.pl</email></author></authors>
|
13 |
-
<date>2013-03-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Smsapi"><dir name="Sms"><dir
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Smsapi_Sms</name>
|
4 |
+
<version>0.1.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>SMSAPI licence</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>SMSAPI Module for Magento-based stores enables automatic send SMS notifications to customers.</summary>
|
10 |
+
<description>SMSAPI Module for Magento-based stores enables automatic send SMS notifications to customers. SMS communication has many benefits including facilitates communication with your customers and speeds up reaching the details of the order. Short text messages are sent primarily as information on the status of the order, such as a message confirming the correct course of a transaction or message about delivery time of orders . SMS is fastest communication with your customers, and savings for the company due to reduced costs associated with undelivered shipments. SMS notifications in Magento module can be sent from the field in active sender SMSAPI account. Content templates are fully editable.</description>
|
11 |
+
<notes>SMSAPI SMS v 0.1.1
|
12 |
+
Some little fixes.</notes>
|
13 |
<authors><author><name>Marek Jasiukiewicz</name><user>jasiukiewicz_m</user><email>dev@jasiukiewicz.pl</email></author><author><name>Snowdog</name><user>snowdog</user><email>support@snowdog.pl</email></author><author><name>SMSAPI</name><user>smsapi</user><email>info@smsapi.pl</email></author></authors>
|
14 |
+
<date>2013-03-22</date>
|
15 |
+
<time>11:22:03</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Smsapi"><dir name="Sms"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Branding.php" hash="849bdf4e1e79bc1e83a871a5d92d69b4"/></dir></dir></dir></dir><file name="Buttons.php" hash="9c3419026c5a9e89ccd6d0203faeee51"/></dir><dir name="Helper"><file name="Data.php" hash="c9f5c5eda233f035bf8d44d5bdf040ea"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Attributes.php" hash="daec22c1bf38a90c4cce45a264f82516"/></dir><file name="ApiClient.php" hash="74ab753538d8effa2d837ac50ebb9b40"/><file name="Config.php" hash="e19170fc3519ba96493770096f730ba0"/><file name="Observer.php" hash="539eff3f0c1c24ec3ebdd92a829329c9"/></dir><dir name="etc"><file name="config.xml" hash="b3723affae72c61b68b850a0b5a4cee4"/><file name="system.xml" hash="7639904e60d72ed0e4c9db9c7f08f2f3"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><file name="Smsapi_Sms.xml" hash="93d7067aa579e4c268b0174164e9f4ff"/></dir><dir name="template"><dir name="sms"><dir name="system"><dir name="config"><dir name="fieldset"><file name="branding.phtml" hash="5e4de796726e17f8230cd51cbf535fd7"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Smsapi_Sms.xml" hash="4e65007f9573a00788a27745861bcaab"/></dir></target><target name="mage"><dir name="js"><dir name="smsapi"><dir name="sms"><file name="counter.js" hash="5ff48e9e8c365324e76526cf160b0c39"/></dir></dir></dir></target><target name="magelocale"><dir name="pl_PL"><file name="Smsapi_Sms.csv" hash="a3995f33f97ea887767c5403aea9ad56"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="images"><dir name="smsapi"><dir name="sms"><file name="smsapi_logo.jpg" hash="8fe4a8d39c915d9e5d138cadf4a3fca4"/></dir></dir></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|