When users subscribe to the newsletter on A Magento Store they receive a confirmation email. Is it possible to prevent this email from being sent?
There doesn't seem to be an option in the back end for this.
When users subscribe to the newsletter on A Magento Store they receive a confirmation email. Is it possible to prevent this email from being sent?
There doesn't seem to be an option in the back end for this.
Do you mean success or confirmation (need to confirm to get newsletter) email?
The latter can be switched off in Configuration->Newsletter
The file you want to override is Mage_Newsletter_Model_Subscriber
. Create a class that overrides that model, and then replace two methods like this:
<?php
class Somepackage_Somemodule_Models_Subscriber extends Mage_Newsletter_Model_Subscriber {
public function sendConfirmationSuccessEmail() {
return $this;
}
public function sendUnsubscriptionEmail() {
return $this;
}
}
This will disable newsletter subscription (and unsubscription) emails to customers.
Hope that helps!
Thanks, Joe
A much easier way, although it is kind of a hack, is to look for the method sendConfirmationSuccessEmail which sends the emails. It is found in:
app/code/core/Mage/Newsletter/Model/Subscriber.php
The only thing you gotta do is to put a return true at the first line of the method.
Isn't there a way to do this through the Magento Configuration settings, instead of modifying the magento core?