Magento: Modify Newsletter Module

The magento mailing table contains fields with first and last names, but with the default setting, only the email address is saved. I would like to use the first name, but I'm having trouble finding where to save the record.

this is what my form looks like:

 <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail">
    <div class="block-content">
        <table>
            <tr>
                <td><label for="firstname"><?php echo $this->__('Name:') ?></label></td>
                <td>
                    <div class="input-box">
                        <input type="text" name="firstname" id="firstname" title="<?php echo $this->__('Name') ?>" class="input-text" />
                    </div>
                </td>
            </tr>
            <tr>
                <td> <label for="newsletter"><?php echo $this->__('Email:') ?></label></td>
                <td>
                    <div class="input-box">
                        <input type="text" name="email" id="newsletter" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="input-text required-entry validate-email" />
                    </div>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <div class="actions">
                        <button type="submit" title="<?php echo $this->__('Subscribe') ?>" class="button"><?php echo $this->__('Sign Up') ?></button>

                    </div>
                </td>
            </tr>
        </table>

    </div>
</form>

There is a similar post there , but I think it is deprecated now, since I cannot find the _prepareSave function.

Can anyone help in the right direction?

Thanks Billy

+3
source share
2 answers

The bulletins and subscriber tables do not indicate the firstname and lastname fields, at least in the latest version of Magento EE 1.9.1.1.

, subscribe Mage_Newsletter_Model_Subscriber ( , ) Mage_Newsletter_SubscriberController, action newAction, $_POST ( $status = Mage::getModel('newsletter/subscriber')->subscribe($email)).

+1

Magento

+2

Source: https://habr.com/ru/post/1776921/


All Articles