ShopwareAG/shopware-4 — pull request #201 by barbieswimcrew (2014-11-20 23:29:54+00:00)
Title: newsletter/indexAction cleanup and passing groupID for Subscription

Shopware()->Modules()->Admin()->sNewsletterSubscription() as used in the indexAction() of the frontend newsletter controller just got passed the subscribed email address and a boolean flag for subscribing/unsubscribing. but the method actually has a third parameter to set the newsletter group optionally. so it isn't possible to subscribe to another newsletter group than the default group.

this feature now will pass the $groupID if existing to make it possible to subscribe to different newsletter groups.

to control the subscription this feature wraps the newsletterExtendedFields in _emotion/frontend/newsletter/index.tpl in a separate smarty block for appending or prepending an input field for setting the groupID to subscribe.

replaced Shopware()-Db() query by new doctrine model persist/flush operation.

this feature also replaces some deprecated Shopware()->System()->_POST function calls by accessing the post data via $this->Request()->getPost() in indexAction() and even doing some tiny clean ups.