1
Magento 1.9.4
Porto theme

I googled and googled and I can't believe I can't find an easy way to do this. This is what's happening:

Some bad person is feeding thousands and thousands of Email addresses into our Newsletter Subscription box. Then Emails go out which say:

logo and "You have been successfully subscribed to the newsletter. Thank you, companyNAME"

Then, when the people receive this Email, they either report it as SPAM or Google's and Yahoo's incoming mail filter won't even let it through and mark us as spammers right away which results in our inability to deliver genuine Order Confirmation Emails to customers.

We would like to keep the option for people to sign up for the Newsletter there but we really need to turn off that Email (allow customers to sign up for the newsletter but NO Email to be sent).

I checked here:

System - Configuration - Customers - Newsletter --> but there is no option NOT to send the Email out - just pick your templates etc.

Simple solutions would be preferred - the only ones I found on the Internet so far were like editing and creating 10 files etc. and that seems unnecessarily complicated for such a simple ask.



Edited on Friday, July 2nd:

Trying to implement the steps proposed by Shoaib Munir below - I found the following code in my Subscriber.php file:

/**
     * Sends out confirmation success email
     *
     * @return Mage_Newsletter_Model_Subscriber
     */
    public function sendConfirmationSuccessEmail()
    {
        if ($this->getImportMode()) {
            return $this;
        }

        if(!Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE)
           || !Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY)
        ) {
            return $this;
        }

Shoaib says to: "change following function, just add return $this;" Where exactly do I add it as it already has return $this; ?


RESOLUTION:

The fix suggested by Shoaib Munir works. My path to copy to is:

/public_html/app/code/core/Mage/Newsletter/Model

My code ended up looking like this:

 }

    /**
     * Sends out confirmation success email
     *
     * @return Mage_Newsletter_Model_Subscriber
     */
    public function sendConfirmationSuccessEmail()
    {
        
        return $this;
        

        if(!Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE)
           || !Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY)
        ) {
            return $this;
        }

I hope this helps someone.

1 Answer 1

1

The file you want to override is Mage_Newsletter_Model_Subscriber.

Copy app\code\core\Mage\Newsletter\Model\Subscriber.php to app\code\local\Mage\Newsletter\Model\Subscriber.php

and change following function, just add return $this;

<?php
    /* If you want to stop confirmation email */
    public function sendConfirmationSuccessEmail() {
        return $this;
    }

    /* If you want to stop unsubscribe email */
    public function sendUnsubscriptionEmail() {
        return $this;
    }    
}

Hope this will work for you

3
  • Hi @Shoaib Munir - my code already has return $this; I've posted my code in my original post if you would please take a look? Am I to add 'return $this;' right under "the public function sendConfirmationSuccessEmail() {" even-though it's there just 2 lines below? Thanks.
    – Allysin
    Commented Jul 2, 2021 at 6:34
  • your return $this is in some conditions. If you really don't want to send confirmation email then remove all conditions and just use return $this so that it will no do anything in send mail function Commented Jul 2, 2021 at 10:08
  • just replace it with the function that I have added in answer, It will work Commented Jul 2, 2021 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.