2 forms to 2 different emails on one-page site

7 replies · opened Oct 27, 2019

VVintageImagesOct 27, 2019

I am trying to get 2 different forms to work on this site: http://amberlands.com/new/
They are going to 2 different email addresses.

The issues I find are

  1. After clicking the send buttons the forms just gray out and there is no feedback.
  2. I don't get the emails to the inboxes specified. There is nothing in spam.
SSemicolon WebSTAFFOct 31, 2019

Hello,

We have checked out your Website and there appears to be some PHP Error in your include/form.php File: http://amberlands.com/new/include/form.php which is why your Form is not working. Please make sure that your PHP is error free to avoid any unexpected issues.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

VVintageImagesDec 3, 2019

The site http://amberlands.com is now live, and the Contact Us form works (the email accounts are hosted on Microsoft 360 and we had a hard time getting them to receive anything). My question is, now that it works, my client asked me to add a dropdown to the form so that the form content will go to a specific email address depending on what is selected from that dropdown. I tried a few things outlined in your documentation that I thought was right, but it just broke the form again. Are there instructions to help a theme owner customize the form so that when someone selects a specific option from a dropdown list, when submitted that email can be directed to a specific inbox. Your help is greatly appreciated.

SSemicolon WebSTAFFDec 4, 2019

Hello,

If you would like to receive Form Responses on different Email Addresses based on the Select Input, you can consider using the following PHP Code in the include/form.php File:

if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {

	if( $_POST['template-contactform-selectinput'] == 'option-1' ) {
		$toemails[] = array(
						'email' => 'your-email-1@website.com', // Your Email Address
						'name' => 'Your Name 1' // Your Name
					);
	} elseif( $_POST['template-contactform-selectinput'] == 'option-2' ) {
		$toemails[] = array(
						'email' => 'your-email-2@website.com', // Your Email Address
						'name' => 'Your Name 2' // Your Name
					);
	} else {
		$toemails[] = array(
						'email' => 'your-email-3@website.com', // Your Email Address
						'name' => 'Your Name 3' // Your Name
					);
	}

}

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

VVintageImagesDec 7, 2019

Hi there Canvas,

I added this to the form.php

/-------------------------------------------------
Form Processor Multiple Emails
---------------------------------------------------
/

if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {

if( $_POST['template-contactform-selectinput'] == 'option-1' ) {
    $toemails[] = array(
                    'email' => 'RentalOffice@amberlands.com', // Your Email Address
                    'name' => 'rental' // Your Name
                );
} elseif( $_POST['template-contactform-selectinput'] == 'option-2' ) {
    $toemails[] = array(
                    'email' => 'Maintenance@amberlands.com', // Your Email Address
                    'name' => 'maintenance' // Your Name
                );
} else {
    $toemails[] = array(
                    'email' => 'Maintenance@amberlands.com', // Your Email Addresss
                    'name' => 'landscaping' // Your Name
                );
}

}

And I added this to the index.html form:

<div class="col_two_third col_last">
<select id="template-contactform-selectinput" name="template-contactform-selectinput" class="sm-form-control border-form-control">
<option value="rental">Rental Information</option>
<option value="maintenance">Maintenance Request</option>
<option value="landscaping">Landscaping Request</option>
</select>
</div>

Unfortunately the form stopped working, so I know I messed up. More SMTP errors. Forgive me for all the questions, I am an amateur at this...

I both kept in and removed this from the form.php and it still did not work

/-------------------------------------------------
Receiver's Email
---------------------------------------------------
/

$toemails = array();

$toemails[] = array(
'email' => 'rentaloffice@amberlands.com', // Your Email Address
'name' => 'Amberlands Realty' // Your Name
);

SSemicolon WebSTAFFDec 7, 2019

Hello,

We Apologize about the Inconveniences, however, we currently do not provide Customization related Support according to the Item Support Policy: https://themeforest.net/page/item_support_policy . You will need to manually code this or Hire a Freelancer to help you out.

You will need to remove the following code:

/*-------------------------------------------------
	Receiver's Email
---------------------------------------------------*/

$toemails = array();

$toemails[] = array(
				'email' => 'your-email@website.com', // Your Email Address
				'name' => 'Your Name' // Your Name
			);

and then use:

/*-------------------------------------------------
	Receiver's Email
---------------------------------------------------*/

$toemails = array();

if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {

	if( $_POST['template-contactform-selectinput'] == 'rental' ) {
		$toemails[] = array(
			'email' => 'RentalOffice@amberlands.com', // Your Email Address
			'name' => 'rental' // Your Name
		);
	} elseif( $_POST['template-contactform-selectinput'] == 'maintenance' ) {
		$toemails[] = array(
			'email' => 'Maintenance@amberlands.com', // Your Email Address
			'name' => 'maintenance' // Your Name
		);
	} else {
		$toemails[] = array(
			'email' => 'Maintenance@amberlands.com', // Your Email Addresss
			'name' => 'landscaping' // Your Name
		);
	}

}

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

VVintageImagesJan 25, 2020

Worked out great! Thanks, Canvas Support Team!

SSemicolon WebSTAFFJan 26, 2020

Hello,

Very Happy to Help! Glad that your issues were resolved.

Do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard