Forums

Send email acoording tot option CF4

Uphill 19 Jul, 2012
I'm trying to make a contactform where the user can choose between two options.
Depending on the option the form must send to a different person/email.

I used the wizard to make my form.
I used dropdown to make the options. Option 1:person 1, option 2, person 2.

But now I want two things and have no idea how to do it.
I want after submit that person 1 goes to [email]person1@mail.com[/email] and If the visitor select person2 the mail goes to [email]person2@mail.com[/email].

And the second thing I want is that the visitor gets a confirmation email with the from email address isbased on his selection.

I did this already with CF 3 but can't get it to work in 4. Any help would be appreciated.
Uphill 19 Jul, 2012
Thank you. I looked at the FAQ but I missed that one.

Still have a problem. After submitting people are getting a white screen instead of my rederect to my homepage.
In debug mode I get the following message:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/vhosts/uphilldevelopment.nl/httpdocs/liavanderfeest/administrator/components/com_chronoforms/form_actions/redirect_url/redirect_url.php on line 31

Any idea how to solve this? I use a lot of chronoform but this one is new for me.
Uphill 19 Jul, 2012
After putting the multiple email receivers in I get an extra line:

Warning: trim() expects parameter 1 to be string, array given in /home/vhosts/uphilldevelopment.nl/httpdocs/liavanderfeest/libraries/joomla/mail/helper.php on line 35

Now I am totally lost.
GreyHead 20 Jul, 2012
Hi Uphill,

Both of these messages are PHP Warnings, not Errors or Failures so they can usually be safely ignored. I can’t see that either of these are likely to be causing your problems.

If you want a simple redirection then you can use the ReDirect User action, you don't need the ReDirect URL action. If you need the redirection to depend on the form results then you can use both but need to enter the URL parameters in the Fields/Params box (I think one of your Warnings is because this is empty).

For the email problems please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Note: if you are using the Easy Wizard you may need to switch to the Advanced Wizard to do this; if you want to continue to use the Easy Wizard please make a copy of your form first and add the Debugger action to the copy.

Bob
Uphill 22 Jul, 2012
I finally get my form to work properly. I still get the php warnings but I turned them off and all works fine now.

I still have problems with the confirmation e-mail.
When the visitor send a message to person 1 or 2 they get a confirmation e-mail with their own message and some more informatiom.
If they send a message to person 1, I want that the from name and the from e-mail is from person 1 and for person 2 I want the same.
So the from name and e-mail has to be dynamic.
I tried modifying the php code form the faq but with no luck.
How do I handle this part of my problem?
GreyHead 23 Jul, 2012
Hi Uphill,

You can use the Dynamic Reply To Email and Name boxes for this.

Bob
Uphill 23 Jul, 2012
Hi Bob,
Thanks for all your help so far.
But how does the dynamic reply to mail and name know wich choice the visitor makes with the dropdown choice.
Do I need a cusfom form eith a if statement or is my thinking trying to make a way to complicated issue of this?
GreyHead 24 Jul, 2012
Hi Uphill,

The code in the FAQ (from earlier in the thread) will let you set values for the Email the user has selected and you can adapt it to add the name as well if you need to. Once you have these values in the $form->data array you can use their names in the Dynamic Reply To Name and Email boxes.

Bob
Uphill 01 Aug, 2012
Hi Bob,

Sorry for my late response. My laptop was to the shop for repair so I couldn't go online very well. :-(

But I finally manage to get my form to work so I'm happy with that. Thanks for all your help.

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