Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Multiple contact forms, need to use custom email template
 
kornbread
Jr. Member
 
Total Posts:  25
Joined:  2008-10-03
 

I have 2 contact us forms. The first is the standard unchanged contact form.  The second is a form for people to request access to our wholesale site.  The second form just has a few extra fields.  I created a custom email template through the admin to handle this form, but I can’t figure out what to use as my form action so that I can use the custom template.

What form action do I use so that I can use the custom email template?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

Unless v1.4 adds a new feature for this purpose (which I don’t see in the v1.4 beta), you can’t use 2 contact forms using the default contacts module as it allows only one email template, you can only use the default contacts template or custom ones. You can create a custom module based on the contacts to handle the request access form.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageWorxcom
Guru
 
Avatar
Total Posts:  410
Joined:  2009-06-03
Washington DC Metro Area, US
 

Hi,

Just FYI, Extended Contacts extension allows sending messages to different emails or departments from a single contact form.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mike
Member
 
Total Posts:  43
Joined:  2007-09-11
Los Angeles, CA
 

Hello. Has anyone found a way to create multiple contact forms within Magento?

The “Extended Contacts” extension above does NOT accomplish the task (it only adds a field to the default contact form).

I need to have both a “Contact Us” page and a “Brochure Request” form (and they need to be completely separate forms).
However, the entire ‘contact form’ system seems tied to Magento’s “Contacts” coding.

Any help is greatly appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
shmk
Sr. Member
 
Total Posts:  297
Joined:  2009-10-28
 
Mike - 15 March 2010 10:23 PM

Hello. Has anyone found a way to create multiple contact forms within Magento?

I need to have both a “Contact Us” page and a “Brochure Request” form (and they need to be completely separate forms).

I’m looking for this too, any suggestion?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

We made a custom module for this purpose based from the Contacts Module.
http://www.ahtechsolutions.com/Selltous/

If you have knowledge in how module works you should be able to figure it out. We are unable to share the module but if you run into issue creating yours, simply post your question here and we will try to answer it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
justintime67
Sr. Member
 
Avatar
Total Posts:  188
Joined:  2009-08-12
 

Can someone please tell me what i am doing wrong? I am trying to add a “subscribe to mailing list” checkbox on my contact form, i can get the box to appear but the information is not emailed with the form.!?

I have only changed one small section of contacts.phtml, do i need to change something else? Thank you for your help

<?php
/**
* Fontis Recaptcha Extension
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to so we can send you a copy immediately.
*
* @category Fontis
* @package Fontis_Recaptcha
* @author Denis Margetic
* @author Chris Norton
* @copyright Copyright (c) 2009 Fontis Pty. Ltd. (http://www.fontis.com.au)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
?>

<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
<div class="page-head">
<h3><?php echo Mage::helper('contacts')->__('Contact Form') ?></h3>
</div>
<form action="<?php echo $this->getFormAction(); ?>” id="contactForm" method="post">
<fieldset class="group-select">
<h4 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h4>
<ul>
<li>
<div class="input-box">
<label for="name"><?php echo Mage::helper('contacts')->__('Your Name') ?> <span class="required">*</span></label><br />
<input name="name" id="name" title="<?php echo Mage::helper('contacts')->__('Name') ?>” value="<?php if($this->helper('contacts')->getUserName() == "") { if(isset($_SESSION["contact_name"])){ echo ($_SESSION["contact_name"]); unset($_SESSION["contact_name"]);}}else{ echo $this->htmlEscape($this->helper('contacts')->getUserName()); } ?>” class="required-entry input-text” type="text" />
</div>

<div class="input-box">
<label for="email"><?php echo Mage::helper('contacts')->__(' Your Email') ?> <span class="required">*</span></label><br />
<input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>” value="<?php if($this->helper('contacts')->getUserEmail() == "") { if(isset($_SESSION["contact_email"])){ echo ($_SESSION["contact_email"]); unset($_SESSION["contact_email"]);}}else{ echo $this->htmlEscape($this->helper('contacts')->getUserEmail()); } ?>” class="required-entry input-text validate-email” type="text" />
</div>

<div class="clear"></div>

<div class="input-box">
<label for="telephone"><?php echo Mage::helper('contacts')->__('Your Telephone') ?></label><br />
<input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>” value="<?php if(isset($_SESSION["contact_telephone"])){ echo ($_SESSION["contact_telephone"]); unset($_SESSION["contact_telephone"]);} ?>” class="input-text" type="text" />
</div>

<div class="clear"></div>
<div class="input-box">
<label for="comment"><?php echo Mage::helper('contacts')->__('Your Message') ?></label><br />
<textarea name="comment" id="comment" title="<?php echo Mage::helper('contacts')->__('Comment') ?>” class="required-entry input-text” style="height:150px;width:auto;" cols="120" rows="5"><?php if(isset($_SESSION["contact_comment"])){ echo ($_SESSION["contact_comment"]); unset($_SESSION["contact_comment"]);} ?></textarea>
</div>
<div class="clear"></div>

<div class="input-box" style="width: 750px">
<input name="newsletter-yes" id="newsletter-yes" title="<?php echo Mage::helper('contacts')->__('newsletter-yes') ?>” value="<?php if(isset($_SESSION["contact_newsletter"])){ echo ($_SESSION["contact_newsletter"]); unset($_SESSION["contact_newsletter"]);} ?>” class="CHK" type="checkbox" CHECKED/>
<label for="newsletter-yes"><?php echo Mage::helper('contacts')->__('Please subscribe me to the Happy Cow monthly newsletter for special offers and new product announcements') ?></label>
</div>

</li>
</ul>
</fieldset>

<?php // recaptcha
if( !(Mage::getStoreConfig("fontis_recaptcha/recaptcha/when_loggedin") && (Mage::getSingleton('customer/session')->isLoggedIn())) )
{
if (Mage::getStoreConfig("fontis_recaptcha/recaptcha/contacts"))
echo $this->getChildHtml('recaptcha_box');
}
?>

<div class="button-set">
<p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
<button class="form-button" type="submit"><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></button>
</div>

</form>
<script type="text/javascript\">
var contactForm = new VarienForm(’contactForm’, true);
</script><br><br><center><h3><strong><i>We reply to emails fast!</i></h3></center></font>

 
Magento Community Magento Community
Magento Community
Magento Community
 
DuDuTaulois
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2010-02-18
 

Just to emphasize the topic, I am also looking for a way to insert three contact forms on the same page (each with a function) and to capture data and send separately.

Only by developing a module?

Tks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lyonscg
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-11-13
Chicago IL
 

This has been an issue for me for quite a while and the only solution I could come up with is using php to break the form into pieces.

There are two problems with this approach that I havn’t been able to fully resolve yet. Maybe someone else can add the missing pieces.

1. All the forms filter through one contact form template.
2. To get multiple success pages, you have to edit a core file.

Assuming you’re okay with the two issues listed above…

Start by opening your contact form which is located:

app/design/frontend/default/THEME/template/contacts/form.phtml

Copy the current form and paste a new copy just below the first.

Using some basic php we will be able to render the appropriate form using $_GET

<?php if(isset($_GET['form2'])): ?>

Paste this code at the very top of the form.phtml file. This first form will be your second form.

Paste <?php else : ?> between the two forms. The form below this will be your standard contact form.

Paste <?php endif ; ?> at the bottom of the file.

So now we have effectively cut the file into two parts based on the url. Simply create a link like: http://www.YourStore.org/index.php/contacts?contacts=1/ This will show the top form while your current contact links will show the second.

To edit the form fields, create form fields like you normally would and use the id in the transactional email template where you want the information to be shown. (Note: If you delete required fields without making them not required first the form will fail.)

Also, as is, when you submit the forms, they will both go back to the original contact form with a thank you message. I’m hesitant to show anyone how to edit the core file that controls this because it isn’t best practices. If anyone has a solution for this please post it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
VEO creativos
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2010-06-07
 
Dr3w00 - 18 June 2010 05:53 AM

This has been an issue for me for quite a while and the only solution I could come up with is using php to break the form into pieces.

There are two problems with this approach that I havn’t been able to fully resolve yet. Maybe someone else can add the missing pieces.

1. All the forms filter through one contact form template.
2. To get multiple success pages, you have to edit a core file.

Assuming you’re okay with the two issues listed above…


Start by opening your contact form which is located:

app/design/frontend/default/THEME/template/contacts/form.phtml


Copy the current form and paste a new copy just below the first.


Using some basic php we will be able to render the appropriate form using $_GET

<?php if(isset($_GET['form2'])): ?>

Paste this code at the very top of the form.phtml file. This first form will be your second form.

Paste <?php else : ?> between the two forms. The form below this will be your standard contact form.

Paste <?php endif ; ?> at the bottom of the file.


So now we have effectively cut the file into two parts based on the url. Simply create a link like: http://www.YourStore.org/index.php/contacts?contacts=1/ This will show the top form while your current contact links will show the second.


To edit the form fields, create form fields like you normally would and use the id in the transactional email template where you want the information to be shown. (Note: If you delete required fields without making them not required first the form will fail.)


Also, as is, when you submit the forms, they will both go back to the original contact form with a thank you message. I’m hesitant to show anyone how to edit the core file that controls this because it isn’t best practices. If anyone has a solution for this please post it.

Hi, I’m always getting the second form with this method… maybe I’m doing something wrong?
Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
rodimmg
Jr. Member
 
Total Posts:  9
Joined:  2009-11-23
 

you have to use this link:

http://www.YourStore.org/index.php/contacts?form2

And you`ll get the first form.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kakkoii
Jr. Member
 
Avatar
Total Posts:  12
Joined:  2009-12-11
 

Hi there,

Quick and robust solution:

call the contact form as a block and specify path to your form template:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form_edited.phtml"}}

You can make as many templates as you like (simply copy and edit) and use them in pages or static blocks.

For AJAX support follow this excellent tip:

http://www.magentocommerce.com/boards/viewthread/210073/

(note - the validation don’t work with this - you can see it but the post will trigger regardless)

When using mulitple forms that are similar - simply add a hidden input that acts as a topic -just don’t forget to add it in the email template.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Magazento
Sr. Member
 
Avatar
Total Posts:  155
Joined:  2010-01-08
Russia,Volgograd
 

If you interested in custom contact form, you may be interested our price feedback extension, it was wrote from scratch and Allows customers to send price feedback directly form product page via Ajax. Simple and convenient.
demo: http://www.magentocommerce.com/extension/demo/17052
extension: http://www.magentocommerce.com/magento-connect/Magazento/extension/6646/magazento_priceproposal
-

 
Magento Community Magento Community
Magento Community
Magento Community
 
dwhiting
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2010-10-14
 
kakkoii - 27 November 2010 04:31 AM

Hi there,
When using multiple forms that are similar - simply add a hidden input that acts as a topic -just don’t forget to add it in the email template.

I would like to do that but I am not sure what you mean by “acts as a topic”.  Also do you have to do anything special to add it to the email template?

--Edit--
I figured out how to do this Here In the comments under the second answer for anyone else who still want to know how to do this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
outsourcedEDM
Member
 
Total Posts:  44
Joined:  2011-06-17
 
kakkoii - 27 November 2010 04:31 AM

Hi there,

Quick and robust solution:

call the contact form as a block and specify path to your form template:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form_edited.phtml"}}

You can make as many templates as you like (simply copy and edit) and use them in pages or static blocks.

For AJAX support follow this excellent tip:

http://www.magentocommerce.com/boards/viewthread/210073/

(note - the validation don’t work with this - you can see it but the post will trigger regardless)

When using mulitple forms that are similar - simply add a hidden input that acts as a topic -just don’t forget to add it in the email template.

Hi Kakkoli,

thanks for the post, it got me most of the way there.. however i’m now getting the message “Unable to submit your request. Please, try again later” when trying to submit my new form. It lets me submit the original contact form without problem.

Also, since this is still calling the ‘contact’ form submission - does the email generated from this still get set in the Contacts section in system->configuration-> contacts space?

 
Magento Community Magento Community
Magento Community
Magento Community
 
madhatter301
Jr. Member
 
Total Posts:  2
Joined:  2010-04-28
 
outsourcedEDM - 21 August 2011 02:18 AM

kakkoii - 27 November 2010 04:31 AM
Hi there,

Quick and robust solution:

call the contact form as a block and specify path to your form template:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form_edited.phtml"}}

You can make as many templates as you like (simply copy and edit) and use them in pages or static blocks.

For AJAX support follow this excellent tip:

http://www.magentocommerce.com/boards/viewthread/210073/

(note - the validation don’t work with this - you can see it but the post will trigger regardless)

When using mulitple forms that are similar - simply add a hidden input that acts as a topic -just don’t forget to add it in the email template.

Hi Kakkoli,

thanks for the post, it got me most of the way there.. however i’m now getting the message “Unable to submit your request. Please, try again later” when trying to submit my new form. It lets me submit the original contact form without problem.

Also, since this is still calling the ‘contact’ form submission - does the email generated from this still get set in the Contacts section in system->configuration-> contacts space?

I’m having the same problem, I dont suppose you managed to get it going? Maybe the form should be posting back to itself rather than the contact page, since that would be expecting different values. Also I have no idea how to hook the form up to the right template. Any suggestions anyone?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2