GetResponse - Version 1.0.4

Version Notes

GetResponse Integration

Download this release

Release Info

Developer GetResponse
Extension GetResponse
Version 1.0.4
Comparing to
See all releases


Code changes from version 1.0.3 to 1.0.4

app/code/community/GetresponseIntegration/Getresponse/Helper/Data.php CHANGED
@@ -59,6 +59,12 @@ class GetresponseIntegration_Getresponse_Helper_Data extends Mage_Core_Helper_Ab
59
  return $this->_files;
60
  }
61
 
 
 
 
 
 
 
62
  /**
63
  * @return mixed
64
  */
59
  return $this->_files;
60
  }
61
 
62
+ public function getNewsletterSubscribersCollection()
63
+ {
64
+ return Mage::getModel('newsletter/subscriber')->getResourceCollection();
65
+ //->addFieldToSelect('email');
66
+ }
67
+
68
  /**
69
  * @return mixed
70
  */
app/code/community/GetresponseIntegration/Getresponse/controllers/IndexController.php CHANGED
@@ -799,9 +799,7 @@ class GetresponseIntegration_Getresponse_IndexController extends Mage_Adminhtml_
799
  */
800
  public function exportCustomers($campaign_id, $params)
801
  {
802
- $customers = Mage::helper('getresponse')->getCustomerCollection();
803
-
804
- //echo "<pre>"; print_r($params); die;
805
 
806
  $cycle_day = '';
807
  if (isset($params['gr_autoresponder']) && 1 == $params['gr_autoresponder']) {
@@ -828,26 +826,43 @@ class GetresponseIntegration_Getresponse_IndexController extends Mage_Adminhtml_
828
  ];
829
 
830
 
831
- if ( !empty($customers)) {
832
- foreach ($customers as $customer) {
833
- $subscriberModel = Mage::getModel('newsletter/subscriber')->loadByEmail($customer->getEmail());
834
- if ($subscriberModel->isSubscribed()) {
835
- $result = Mage::helper('getresponse/api')->addContact(
836
- $campaign_id,
837
- $customer->getName(),
838
- $customer->getEmail(),
839
- $cycle_day,
840
- Mage::getModel('getresponse/customs')->mapExportCustoms($custom_fields, $customer)
841
- );
842
-
843
- if (GetresponseIntegration_Getresponse_Helper_Api::CONTACT_CREATED === $result) {
844
- $reports['created'] ++;
845
- } elseif(GetresponseIntegration_Getresponse_Helper_Api::CONTACT_UPDATED == $result) {
846
- $reports['updated'] ++;
847
- } else {
848
- $reports['error'] ++;
849
- }
850
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
851
  }
852
  }
853
 
799
  */
800
  public function exportCustomers($campaign_id, $params)
801
  {
802
+ $subscribers = Mage::helper('getresponse')->getNewsletterSubscribersCollection();
 
 
803
 
804
  $cycle_day = '';
805
  if (isset($params['gr_autoresponder']) && 1 == $params['gr_autoresponder']) {
826
  ];
827
 
828
 
829
+ if ( !empty($subscribers)) {
830
+ foreach ($subscribers as $subscriber) {
831
+ $customer = Mage::getResourceModel('customer/customer_collection')
832
+ ->addAttributeToSelect('email')
833
+ ->addAttributeToSelect('firstname')
834
+ ->addAttributeToSelect('lastname')
835
+ ->joinAttribute('street', 'customer_address/street', 'default_billing', null, 'left')
836
+ ->joinAttribute('postcode', 'customer_address/city', 'default_billing', null, 'left')
837
+ ->joinAttribute('city', 'customer_address/postcode', 'default_billing', null, 'left')
838
+ ->joinAttribute('telephone', 'customer_address/telephone', 'default_billing', null, 'left')
839
+ ->joinAttribute('country', 'customer_address/country_id', 'default_billing', null, 'left')
840
+ ->joinAttribute('company', 'customer_address/company', 'default_billing', null, 'left')
841
+ ->joinAttribute('birthday', 'customer/dob', 'entity_id', null, 'left')
842
+ ->addFieldToFilter(array(
843
+ array('attribute'=>'email','eq'=>$subscriber->getEmail())
844
+ ))->getFirstItem();
845
+
846
+ if (!empty($customer)) {
847
+ $name = $customer->getName();
848
+ } else {
849
+ $name = 'Friend';
850
+ }
851
+ $result = Mage::helper('getresponse/api')->addContact(
852
+ $campaign_id,
853
+ $name,
854
+ $subscriber->getEmail(),
855
+ $cycle_day,
856
+ Mage::getModel('getresponse/customs')->mapExportCustoms($custom_fields, $customer)
857
+ );
858
+
859
+ if (GetresponseIntegration_Getresponse_Helper_Api::CONTACT_CREATED === $result) {
860
+ $reports['created'] ++;
861
+ } elseif(GetresponseIntegration_Getresponse_Helper_Api::CONTACT_UPDATED == $result) {
862
+ $reports['updated'] ++;
863
+ } else {
864
+ $reports['error'] ++;
865
+ }
866
  }
867
  }
868
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>GetResponse</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license>GNU</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>GetResponse integration</description>
11
  <notes>GetResponse Integration</notes>
12
  <authors><author><name>GetResponse</name><user>gstruczynski</user><email>gstruczynski@getresponse.com</email></author></authors>
13
- <date>2017-01-04</date>
14
- <time>14:20:00</time>
15
- <contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="GetresponseIntegration"><dir name="Getresponse"><dir name="Block"><dir name="Adminhtml"><file name="Adminblock.php" hash="0ad06d81dd175a56b4b90a2846617877"/></dir><file name="Getresponse.php" hash="32ca083c81b2d7f87357508061465118"/></dir><dir name="Helper"><file name="Api.php" hash="fbceff33ed7f46556f537117cc893164"/><file name="Data.php" hash="5719248c52d1f60787e514c094d8c690"/><file name="GrApi.php" hash="8894b5711c501599f8a4c388b8d9608a"/><file name="GrShop.php" hash="6e8cc92c9327ba316d3cb2f8e26dd426"/></dir><dir name="Model"><file name="Account.php" hash="b45fd3eed3f4d05ab9c03ddc91ff17f6"/><file name="Automations.php" hash="3d8c1a129022a37f6c85b6faa33a4252"/><file name="Customs.php" hash="e137743c9b34a242d52bf0ed0f40b794"/><file name="Observer.php" hash="e9a66d6f03d7bf18600a7f7cf537f819"/><dir name="Resource"><dir name="Account"><file name="Collection.php" hash="624f58c7a83294650922d9a7a45b1974"/></dir><file name="Account.php" hash="9432375297daa51675b15b499c2646bb"/><dir name="Automations"><file name="Collection.php" hash="cacb1df3b9bf939bf5f25c9131a5bc28"/></dir><file name="Automations.php" hash="98a3b43796699e32047e3e126cc5bc02"/><dir name="Customs"><file name="Collection.php" hash="8c24203f9d7361e0f289a2a11476c76e"/></dir><file name="Customs.php" hash="7d02c5cb590197537d0395bcd6097403"/><dir name="Settings"><file name="Collection.php" hash="27cb24c2f12cb124e84a15317864ba05"/></dir><file name="Settings.php" hash="86aaed24693e442ad88f54f0fbd53758"/><file name="Setup.php" hash="aa38a1f6cc9e7e207d3e23ba14cb6044"/><file name="Shop.php" hash="ba84ea2eef9e534f254ad7bffc828dac"/><dir name="Webforms"><file name="Collection.php" hash="dd1576c1be5783b5fe312b2930dde00d"/></dir><file name="Webforms.php" hash="2aa38d6cbdc06b77d21d09cb1e84431b"/></dir><file name="Settings.php" hash="aed16cf6b22cec5edf7236a26b533a11"/><file name="Shop.php" hash="af6bf55bc719dac448851cba3a3a73c0"/><file name="Webforms.php" hash="a87719dc7c19812e7b65c99cbf749d6a"/></dir><dir name="controllers"><file name="IndexController.php" hash="b4ecc577842c103589f43d1c7d310627"/><file name="ShopController.php" hash="0c42d97a689c6d4957233128929d917d"/></dir><dir name="etc"><file name="config.xml" hash="413cc818fdc38d4b473f89886cdd11eb"/></dir><dir name="sql"><dir name="getresponse_setup"><file name="install-1.0.0.php" hash="cb466ca6ca52f2069e7e2164023c3fcc"/><file name="upgrade-1.0.0-1.0.2.php" hash="28876ad063475894cc2ee1876cb02e90"/></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="GetresponseIntegration.xml" hash="be731e09168a813cb212b8fca5e965ee"/></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="getresponse_integration.xml" hash="47671a4fa68bc507e84ac249c4ae6c16"/></dir><dir name="template"><dir name="getresponse"><file name="account.phtml" hash="63008fca38ce2e2b1c14886d7087a0aa"/><file name="add_automation.phtml" hash="22acb48c46780566e267f90c2472e40d"/><file name="add_campaign.phtml" hash="650a91ce92255f78fc82e9c8f7b03800"/><file name="add_shop.phtml" hash="91140cae7e786333ea3e8d7df48f9fed"/><file name="apikey.phtml" hash="6fd5d3b170db5227de12be250b76a590"/><file name="automation.phtml" hash="f6a398a744de84f7a424cc7af896a5b9"/><file name="automation_js.phtml" hash="f3297dcf4c0832516ae862b93114d135"/><file name="export.phtml" hash="2df8f56dba76573ca6c969eb4ad0d43a"/><file name="menu.phtml" hash="487e39383d3b92034a5d089a25c44dbc"/><file name="shop.phtml" hash="504826a381e8f7ed611239cdca5cf94a"/><file name="viapage.phtml" hash="50c82ed634bbab27abbe4c23f79067b8"/><file name="viawebform.phtml" hash="6c7cd09828f700d05932414ce1c247b8"/><file name="webtraffic.phtml" hash="e0bce42aa52c268d073b644a61e31cb6"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="getresponse"><dir><dir name="checkout"><file name="billing.extra.phtml" hash="2b71b0160320554c93055f31088301da"/></dir></dir><file name="webform.phtml" hash="c97a8bb5e55f512b751302716d3604ab"/></dir></dir><dir name="layout"><file name="getresponse.xml" hash="ccadd00312dba6de863f9c7c9cf6c92e"/></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="getresponse"><file name="getresponse.phtml" hash="5ee6103a36e4b98079680579e32b4ded"/></dir></dir></dir></dir></dir></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><file name="getresponse-custom-field.css" hash="6c57a9a936a3107fa2f271ade637aa44"/><file name="getresponse.css" hash="fb10f2de00eb86b15d5ddc1299214b51"/><dir><dir name="images"><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="4d4e638960a1a29b0d6b693b445087da"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="d0cc3ffc3dc84d3a7c48867c75e2485f"/><file name="ui-bg_flat_10_000000_40x100.png" hash="c31d5fc3eb7d82c628a82e3b87024cd1"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="c17f552e8f4697d7608c57653af36df0"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="fe58c3539111d3021776e6833169c5e1"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="b624f702075cd719a38f428e143025ea"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="23932de7c235b03187b8a5de3d024490"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="0b708185ce8927f18c7b3b82a7e7c247"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="53acc69aaee6e2cb73b2021317e24af3"/><file name="ui-icons_222222_256x240.png" hash="4c27b34156b7a3776f31cc456ca01c10"/><file name="ui-icons_228ef1_256x240.png" hash="2f257489d9600ddf56d195a179ebc9df"/><file name="ui-icons_ef8c08_256x240.png" hash="772a64d6df4b93d230e9b38e1ab7522a"/><file name="ui-icons_ffd27a_256x240.png" hash="6686d21b904e18b100210169bb1c04ad"/><file name="ui-icons_ffffff_256x240.png" hash="a19fe1b2d726e920c12e43a65df9039a"/></dir></dir><file name="jquery-ui.min.css" hash="26812a28850395f8f865be4893fb20c7"/><file name="jquery.switchButton.css" hash="afa60ae180e5d2d5ed65bf5feba96be1"/></dir><dir name="images"><dir name="getresponse"><file name="getresponse_icons.png" hash="ad368ba26172b3a90d8fe373eec0cd52"/><file name="loader.big.white.gif" hash="f27ae53fdc1c8c55f0d249b72592d75d"/></dir></dir></dir></dir></dir></dir><dir name="js"><dir name="getresponse"><file name="getresponse-custom-field.src-verified.js" hash="5643f2df123db3ec92be40dc139703ea"/><file name="jquery-1.11.3.min.js" hash="895323ed2f7258af4fae2c738c8aea49"/><file name="jquery-ui.min.js" hash="d935d506ae9c8dd9e0f96706fbb91f65"/><file name="jquery.noconflict.js" hash="09bfdd3b964eb2b17b5d6caa1d20a607"/><file name="jquery.switchButton.js" hash="86aeb2caefce157c567434ef972f670b"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>5.6.50</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>GetResponse</name>
4
+ <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license>GNU</license>
7
  <channel>community</channel>
10
  <description>GetResponse integration</description>
11
  <notes>GetResponse Integration</notes>
12
  <authors><author><name>GetResponse</name><user>gstruczynski</user><email>gstruczynski@getresponse.com</email></author></authors>
13
+ <date>2017-05-18</date>
14
+ <time>11:39:12</time>
15
+ <contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="GetresponseIntegration"><dir name="Getresponse"><dir name="Block"><dir name="Adminhtml"><file name="Adminblock.php" hash="0ad06d81dd175a56b4b90a2846617877"/></dir><file name="Getresponse.php" hash="32ca083c81b2d7f87357508061465118"/></dir><dir name="Helper"><file name="Api.php" hash="fbceff33ed7f46556f537117cc893164"/><file name="Data.php" hash="c5bf1da28bcb8ad0e72741ef6fb1ee42"/><file name="GrApi.php" hash="8894b5711c501599f8a4c388b8d9608a"/><file name="GrShop.php" hash="6e8cc92c9327ba316d3cb2f8e26dd426"/></dir><dir name="Model"><file name="Account.php" hash="b45fd3eed3f4d05ab9c03ddc91ff17f6"/><file name="Automations.php" hash="3d8c1a129022a37f6c85b6faa33a4252"/><file name="Customs.php" hash="e137743c9b34a242d52bf0ed0f40b794"/><file name="Observer.php" hash="e9a66d6f03d7bf18600a7f7cf537f819"/><dir name="Resource"><dir name="Account"><file name="Collection.php" hash="624f58c7a83294650922d9a7a45b1974"/></dir><file name="Account.php" hash="9432375297daa51675b15b499c2646bb"/><dir name="Automations"><file name="Collection.php" hash="cacb1df3b9bf939bf5f25c9131a5bc28"/></dir><file name="Automations.php" hash="98a3b43796699e32047e3e126cc5bc02"/><dir name="Customs"><file name="Collection.php" hash="8c24203f9d7361e0f289a2a11476c76e"/></dir><file name="Customs.php" hash="7d02c5cb590197537d0395bcd6097403"/><dir name="Settings"><file name="Collection.php" hash="27cb24c2f12cb124e84a15317864ba05"/></dir><file name="Settings.php" hash="86aaed24693e442ad88f54f0fbd53758"/><file name="Setup.php" hash="aa38a1f6cc9e7e207d3e23ba14cb6044"/><file name="Shop.php" hash="ba84ea2eef9e534f254ad7bffc828dac"/><dir name="Webforms"><file name="Collection.php" hash="dd1576c1be5783b5fe312b2930dde00d"/></dir><file name="Webforms.php" hash="2aa38d6cbdc06b77d21d09cb1e84431b"/></dir><file name="Settings.php" hash="aed16cf6b22cec5edf7236a26b533a11"/><file name="Shop.php" hash="af6bf55bc719dac448851cba3a3a73c0"/><file name="Webforms.php" hash="a87719dc7c19812e7b65c99cbf749d6a"/></dir><dir name="controllers"><file name="IndexController.php" hash="52205639fbb7b7821129807ba2627180"/><file name="ShopController.php" hash="0c42d97a689c6d4957233128929d917d"/></dir><dir name="etc"><file name="config.xml" hash="413cc818fdc38d4b473f89886cdd11eb"/></dir><dir name="sql"><dir name="getresponse_setup"><file name="install-1.0.0.php" hash="cb466ca6ca52f2069e7e2164023c3fcc"/><file name="upgrade-1.0.0-1.0.2.php" hash="28876ad063475894cc2ee1876cb02e90"/></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="GetresponseIntegration.xml" hash="be731e09168a813cb212b8fca5e965ee"/></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="getresponse_integration.xml" hash="47671a4fa68bc507e84ac249c4ae6c16"/></dir><dir name="template"><dir name="getresponse"><file name="account.phtml" hash="63008fca38ce2e2b1c14886d7087a0aa"/><file name="add_automation.phtml" hash="22acb48c46780566e267f90c2472e40d"/><file name="add_campaign.phtml" hash="650a91ce92255f78fc82e9c8f7b03800"/><file name="add_shop.phtml" hash="91140cae7e786333ea3e8d7df48f9fed"/><file name="apikey.phtml" hash="6fd5d3b170db5227de12be250b76a590"/><file name="automation.phtml" hash="f6a398a744de84f7a424cc7af896a5b9"/><file name="automation_js.phtml" hash="f3297dcf4c0832516ae862b93114d135"/><file name="export.phtml" hash="2df8f56dba76573ca6c969eb4ad0d43a"/><file name="menu.phtml" hash="487e39383d3b92034a5d089a25c44dbc"/><file name="shop.phtml" hash="504826a381e8f7ed611239cdca5cf94a"/><file name="viapage.phtml" hash="50c82ed634bbab27abbe4c23f79067b8"/><file name="viawebform.phtml" hash="6c7cd09828f700d05932414ce1c247b8"/><file name="webtraffic.phtml" hash="e0bce42aa52c268d073b644a61e31cb6"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="getresponse"><dir><dir name="checkout"><file name="billing.extra.phtml" hash="2b71b0160320554c93055f31088301da"/></dir></dir><file name="webform.phtml" hash="c97a8bb5e55f512b751302716d3604ab"/></dir></dir><dir name="layout"><file name="getresponse.xml" hash="ccadd00312dba6de863f9c7c9cf6c92e"/></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="getresponse"><file name="getresponse.phtml" hash="5ee6103a36e4b98079680579e32b4ded"/></dir></dir></dir></dir></dir></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><file name="getresponse-custom-field.css" hash="6c57a9a936a3107fa2f271ade637aa44"/><file name="getresponse.css" hash="fb10f2de00eb86b15d5ddc1299214b51"/><dir><dir name="images"><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="4d4e638960a1a29b0d6b693b445087da"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="d0cc3ffc3dc84d3a7c48867c75e2485f"/><file name="ui-bg_flat_10_000000_40x100.png" hash="c31d5fc3eb7d82c628a82e3b87024cd1"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="c17f552e8f4697d7608c57653af36df0"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="fe58c3539111d3021776e6833169c5e1"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="b624f702075cd719a38f428e143025ea"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="23932de7c235b03187b8a5de3d024490"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="0b708185ce8927f18c7b3b82a7e7c247"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="53acc69aaee6e2cb73b2021317e24af3"/><file name="ui-icons_222222_256x240.png" hash="4c27b34156b7a3776f31cc456ca01c10"/><file name="ui-icons_228ef1_256x240.png" hash="2f257489d9600ddf56d195a179ebc9df"/><file name="ui-icons_ef8c08_256x240.png" hash="772a64d6df4b93d230e9b38e1ab7522a"/><file name="ui-icons_ffd27a_256x240.png" hash="6686d21b904e18b100210169bb1c04ad"/><file name="ui-icons_ffffff_256x240.png" hash="a19fe1b2d726e920c12e43a65df9039a"/></dir></dir><file name="jquery-ui.min.css" hash="26812a28850395f8f865be4893fb20c7"/><file name="jquery.switchButton.css" hash="afa60ae180e5d2d5ed65bf5feba96be1"/></dir><dir name="images"><dir name="getresponse"><file name="getresponse_icons.png" hash="ad368ba26172b3a90d8fe373eec0cd52"/><file name="loader.big.white.gif" hash="f27ae53fdc1c8c55f0d249b72592d75d"/></dir></dir></dir></dir></dir></dir><dir name="js"><dir name="getresponse"><file name="getresponse-custom-field.src-verified.js" hash="5643f2df123db3ec92be40dc139703ea"/><file name="jquery-1.11.3.min.js" hash="895323ed2f7258af4fae2c738c8aea49"/><file name="jquery-ui.min.js" hash="d935d506ae9c8dd9e0f96706fbb91f65"/><file name="jquery.noconflict.js" hash="09bfdd3b964eb2b17b5d6caa1d20a607"/><file name="jquery.switchButton.js" hash="86aeb2caefce157c567434ef972f670b"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>5.6.50</max></php></required></dependencies>
18
  </package>