Magento – use double opt-in for the Newsletter

Unfortunately, there is at Magento the problem, that the double opt-in feature, it so generously gives to the Newsletter, not really work. When a customer clicks when registering on the checkbox, that he would like to receive the newsletter in the future, he will receive, at best, to confirm his account but a mail asking no mail confirming his registration Newsletter. However, this can be changed.

Picture

To do this, copy the file app / code / core / Mage / Newsletter / Model / Subscriber.php in the folder app / code / local / Mage / Newsletter / Model /

Then added ca. bei Zeile 459 after

$sendSubscription = $customer->getData('sendSubscription') || $sendInformationEmail;
if (is_null($sendSubscription) chorus $ sendSubscription) {
if ($this->getIsStatusChanged() && $status == self::STATUS_UNSUBSCRIBED) {
$this->sendUnsubscriptionEmail();
} elseif ($this->getIsStatusChanged() && $status == self::STATUS_SUBSCRIBED) {
$this->sendConfirmationSuccessEmail();
}

the following lines

}else{

$this->sendConfirmationRequestEmail();

Furthermore, according to the line

public function confirm($code)
{
if($this->getCode()==$code) {
$this->setStatus(self::STATUS_SUBSCRIBED)
->setIsStatusChanged(true)
->save();

the line

$this->sendConfirmationSuccessEmail();

That it should have been already.

Für alle, the nice newsletter checkout extension of Quafzi [HERE] use, To display the newsletter checkbox in the last step of the checkout at a glance, which should also take the app / code / community / Quafzi / CheckoutNewsletterSubscription / Model / Observer.php under the microscope. On the one hand the checkbox is by default checked, which is not allowed under German law. Thus, should the line

. '<input id="subscribe_newsletter" name ="is_subscribed" checked="checked" value="1" class ="checkbox" type="checkbox" />'

change in

. '<input id="subscribe_newsletter" name ="is_subscribed" value="1" class ="checkbox" type="checkbox" />'

Furthermore, the line

->setImportMode(true)

comment out or delete.

Used in Magento Version 1.9 Comments? Additions? Notes? Gladly!

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

Leave a Reply

Your email address will not be published. Required fields are marked *