1

I have a Magento website for sorts of people use. So i want to make multiple Magento contact forms depending on the users type.

I make the contact forms that emails have received to general email i've fixed on Magento back-end server. I just duplicated first one to make the other form. but i can't find how to separate the destination of contact.

<div id="shop-mail">

<div class="page-title">
    <h1><?php echo Mage::helper('contacts')->__('Contact Us') ?></h1>
</div>
<form action="<?php echo $this->getFormAction(); ?>" id="contactForm"     method="post" class="scaffold-form">
    <div class="fieldset">
        <h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>
        <p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
        <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="email" autocapitalize="off" autocorrect="off" spellcheck="false" />
                </div>
            </div>
        </li>
        <li>
            <label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>
            <div class="input-box">
                <input name="telephone" id="telephone" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Telephone')) ?>" value="" class="input-text" type="tel" />
            </div>
        </li>
        <li class="wide">
            <label for="comment" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Comment') ?></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">
    <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>

0

I think the solution to that will be in your backend code. Can you post that as well? In short, you'll likely need to create controller that is a copy of the other one that you can send the form to, but that has a different email address inside.

I recommend creating one abstract class controller in the Controller directory that has the email sending and form receiving mechanism, and then two controllers that inherit it. I'd require each concrete implementation to provide a getEmailAddress() method that returns the email address that you want each form to submit to. You will also have to update the form action for each form.

Please let me know if you have any questions!

  • Can i follow this process? - advancedcheckout.com/blog/… actually,I'm quite newbie to Magento and the version of mine is 1.9.x . So i don't exactly know where i should make directory for this form? If you don't mind, could you let me know the simple question? Thank you so much! – 3CE Jan 30 '17 at 17:04

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.