Forums

Send to Email Address Depending on Dropdown

davec 22 Nov, 2013
I have now managed to get this working however, 2 further isssues have arisen.

1. The department name does not show on the received email.

2 I am getting validation errors on the page.

Array
(
    [chronoform] => Contactlowestoft-Copy
    [event] => submit
    [email_address] => info@****.co.uk
    [your_name] => dave
    [your_enquiry] => test 7
    [recipients] => Support Enquiries
    [send_enquiry] => Send Your Enquiry
    [09724474aa29a3afe609d4589c43ec84] => 1
    [email_to_use] => user@hotmail.com
)

Validation Errors:

Array
(
)


The received email looks like this

Your Email: info@****.co.uk
Your Name: dave
What Is Your Enquiry? test 7
Department


Dave 8)
GreyHead 22 Nov, 2013
Hi Dave,

The form results from a drop down and radio buttons are identical. Try the FAQ as it is and it should work OK.

Bob
davec 25 Nov, 2013
Hi Bob

I did make a small change, ie email addresses the code I used is here

<?php
$recipient = JRequest::getString('recipients', 'General Enquiries', 'post');
$emails = array (
'Please Select'=>'Please Select',
  'General Enquiries' => 'user1@hotmail.com',
  'Product Enquiries' => 'user2@hotmail.com',
  'Support Enquiries' => 'user3@hotmail.com',
  'Account Enquiries' => 'user4@hotmail.com' );
$form->data['email_to_use'] = $emails[$recipient];
?>

I a get another error at the bottom of the form

 array ( )

redirect_user

    Error: No Redirect URL found


This has not been set in the form so I have no idea why this should be happening

Dave
davec 27 Nov, 2013
Well I have tried to set the form using the same info as the FAQ and still without success. I would really appreciate some help with this???

It would be nice to know exactly what settings are required and where!

Dave 8)
GreyHead 27 Nov, 2013
Hi davec,

I'm no longer clear what the problem is?

The email_to_use address is being set OK (looking at an earlier post).

To put the department name in the email add {recipients} - just like any other input.

The Validation Errors is created by the Debugger, it's an empty array so there are no errors.

Bob
This topic is locked and no more replies can be posted.