ebizmarts/magemonkey — pull request #17 by riker09 (2014-08-18 08:58:02+00:00)
Title: Fixed Webhook URL in multi-store environment

When in multi-store environment its not unusual to add the store code to the url. Lets say you have two store views A and B with store codes `store-a` and `store-b` with store A being the default store. I want the two stores to have complete separated lists so I setup my mailchimp configuration with two api keys. The lists are pulled from the mailchimp api but when changing the default list for store B the generated webhook url looks like this:

`http://my.domain.tld/store-a/store-b/monkey/webhook/index/wkey/dd69b2df6698776bstore-b/`

`store-a` should not be there, the url returns a 404. The culprit is this line in class WebhookController:

```php
Mage::app()->setCurrentStore(Mage::app()->getDefaultStoreView());
```
I don't see the reason why this line needs to be there, but just in case I enclosed it in a conditional statement that only disables it when the store codes are appended to the url.

##### Bonus
Changed tabs to spaces and improved readability of controller class