Form as a Contact Form

Permalink
I'm trying to use the Form as a contact form and would like the 'from' to show up as an email address that they enter. Ideas on how to accomplish this?

 
hbartlett replied on at Permalink Reply
hbartlett
I am also interested in this. Presently the form send the mail with Concrete5@ as the from address.
Tony replied on at Permalink Reply
Tony
as of 5.3.2 the form block isn't able to do this, unless you customize it to do so.
wesyah234 replied on at Permalink Reply
I am looking to do the same thing. I think the reason it's not supported directly is because the form is actually very generic... there's not a specific "From" field that the user must fill out. The fields of the form are completely variable, so Concrete would not know which field to use as the "From". A possible solution would be to have a static From field that was separate from the fields defined when creating the form.

The reason I'm looking at this is because the website owner would like to be able to just hit reply when the email notification of the contact form comes in, and when they do this, it comes back to their own email.

The other trouble with this is that Gmail "threads" all messages that come from the same sender, so different contacts from different people all are grouped together in gmail...
Insiston replied on at Permalink Reply
Insiston
For my clients I generally will use Google Apps and change the DNS and Mx records to allow Gmail to be the post office. It can handle as many mail boxes as most sites will need. Beats using Horde or squirrel mail type web mail systems.

You can also use gmail forwarder settings so that any email forwarded to your "clearing house" email address will reply "as if" it came from the forwarded source. This is all done in the settings area.

a little bit of work to setup but until a mail block is available for concrete5 its a good alternative.

--------------------------------------

I just had a client wig out because he thought all mail from his reservations forms was coming through us first then forwarded to him.

This is because when you set up the site and and input your email address, the form response notification email takes this "super administrator" email address and uses it as the "sender" of the email notification.

To keep this from happening, I took the "super administrator email' and changed it.

I setup a submissions@clientwebsite.com mail box and used this in place of my email. So now the "Form Submission" notification email reflects the clients site and not ours. Nothing is ever sent to the submissions mailbox so no need to monitor but prevents client wig outs.
Insiston replied on at Permalink Reply
Insiston
For my clients I generally will use Google Apps and change the DNS and Mx records to allow Gmail to be the post office. It can handle as many mail boxes as most sites will need. Beats using Horde or squirrel mail type web mail systems.

You can also use gmail forwarder settings so that any email forwarded to your "clearing house" email address will reply "as if" it came from the forwarded source. This is all done in the settings area.

a little bit of work to setup but until a mail block is available for concrete5 its a good alternative.
cgrauer replied on at Permalink Reply
cgrauer
GMail uses subject, not from for threading!
plschneide replied on at Permalink Reply
plschneide
This would be a great thing to add. I imagine it is pretty common.
AVL replied on at Permalink Reply
AVL
Did anyone ever figure this out? It would be nice to just hit Reply and have the email go to the customer...
Shotster replied on at Permalink Reply
Shotster
If you're comfortable coding with PHP, it's relatively easy to override the built-in form block's controller and get that functionality. Otherwise, you might want to check the marketplace. I know there's an "extended form" add-on. Whether or not it does what you want I'm not sure, but you can ask the developer.

-Steve
AVL replied on at Permalink Reply
AVL
Thank you Steve. I sent an inquiry about the extended form block to see if it has that functionality. I am comfortable finding the php code and replacing with pre-written code, but I am not familiar with actually creating the code. I had found a thread in here that seemed to go over what could be done, but at the end of the day, I wasn't able to make it work.

Thanks again!
jjcdesign replied on at Permalink Reply
Have you managed to have any success with this?

Steve mentions above that it's 'easy' but to me unfortunately it's not :-(

If anyone who has the know-how could actually show us how to do this, I'm sure there are a lot of people out there (including me) who would be eternally grateful!
AVL replied on at Permalink Reply
AVL
Well, I was going to say I didn't get anything to work, but your post got me looking again and I think I found something. However, it will only work for one form. The questions of all forms continue the numbering sequence for questions. ie: form one has question1, question2 and then form two has question3 and question4.

So if you only have one form, you're golden... unless you can figure out how to put an OR statement in there. I have 3 forms on my website and the email is in the 2nd spot on each form, but shows as question2, question10 and question22. Use View Page Source in your browser to see what question number you have.

Anyway - I used the code from the last post in this thread:http://www.concrete5.org/community/forums/customizing_c5/form_block...

Here's what my site.php file looks like (hope I took out all the sensitive info) under public_html/config. Make sure you don't accidentally put any spaces or anything with that php code at the bottom or it will mess up your site.

<?php 
define('DB_SERVER', 'XXXX');
define('DB_USERNAME', 'XXXX');
define('DB_PASSWORD', 'XXXX');
define('DB_DATABASE', 'XXXX');
# special code to intercept contact us pages and set the FROM adddress properly
if (!empty($_POST)) {
    # default to admin
    $final_email = 'no-reply@<yoursite.com>';
    # if we have something in Question2 (my email is question2)
    if ($_POST['Question2']) {
        $test_email = preg_replace("/[\r\n]/", '', $_POST['Question2']);
        # check to see if it's a valid email address
        if (eregi("^['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$", $test_email)) {
            # we passed the syntax check, let's check the dns records

eta: also, it sounds silly, but remember to click View entire code block, since it's shortening the code preview.
tommyh replied on at Permalink Reply
tommyh
Did this fix your issue? How do you find out what question 2 is in the code. I have email as the 2nd place in the form. Does this mod affect all forms on the site (example would be guestbook)? if so, what is the workaround to make it only do a contact form on a given page?

Thanks a bunch!
Tommy
AVL replied on at Permalink Reply
AVL
Hi there - yes, this fixed the issue somewhat - we only have one main form and a few not-so-important ones.

No two forms can have the same numbered question. So if form 1 has a question 2, then no other form in your website will have question 2.

ie: say form 1 has Q1, Q2, and Q3. Then form 2 will start with Q4 and so on.

You can find out what question it is by viewing the Page Source code - find where your form is and what the Email field is named.

Let me know if you need more clarification and good luck!