2

I want to create a contact form where customers can contact me on different email to the one specified in the Magento back-end configuration.

I have a form.phtml file in /http/app/design/frontend/theme/theme/template/contacts/form.phtml and I want to have exactly the same form but on different cms page which will send the information to a different email address.

Do I copy the form.phtml and name form2.phtml but how do I adjust it so it sends the email to a different email address?

My goal is to create a "contact us" where customer can fill in some information and then "submit" it and it will send the information to a specified email.

Here is my form.phtml:

            <div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
            <div class="page-title">
                <h1><?php echo Mage::helper('contacts')->__('Contact Us') ?></h1>
            </div>
            <form action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post">
                <div class="fieldset">
                    <h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>
                    <ul class="form-list">
                        <li class="fields">
                            <div class="field">
                                <label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name') ?></label>
                                <div class="input-box">
                                    <input name="name" id="name" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Name')) ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />
                                </div>
                            </div>
                            <div class="field">
                                <label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email') ?></label>
                                <div class="input-box">
                                    <input name="email" id="email" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Email')) ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="text" />
                                </div>
                            </div>
                        </li>
                        <li class="wide">
                            <label for="comment" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Company Name') ?></label>
                            <div class="input-box">
                                <textarea name="comment" id="comment" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Comment')) ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="buttons-set">
                    <p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
                    <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
                    <button type="submit" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Submit')) ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
                </div>
            </form>
            <script type="text/javascript">
            //<![CDATA[
                var contactForm = new VarienForm('contactForm', true);
            //]]>
            </script>

I have created a new CMS page in magento back end and included this:

{{block type="core/template" template="contacts/form.phtml"}}

It displayes the form correctly but where does it send the email to? How do I adjust it or change it without changing different forms? Bare in mind that I do have a standard "contact us" page with email specified and I do not want to change it but instead send this form to another email.

2

You have to create another custom form, like this Inchoo tuto, then you can include the form in your cms page according this tuto like this:

{{block type="core/template" name="form.custom" form_action="/simpleContact/index/sendemail" template="inchoo/simple_contact.phtml"}}
  • Thank you for the reply. I will give it a go and let you know how it went. Once more thank you for directing me. – Greg Jun 28 '17 at 10:39
  • 1
    You are welcome ;) – PЯINCƏ Jun 28 '17 at 14:43
  • Hey, Since you recomended this way, you might help me with this: magento.stackexchange.com/questions/181154/… – Greg Jun 28 '17 at 15:13
  • It's probably quick and easy to fix but drives me insane for hours now! – Greg Jun 28 '17 at 15:14
  • Look my answer in that post – PЯINCƏ Jun 29 '17 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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