This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

How to send a Copy of the form


  1. zentering
    Member

    Hi, all!

    I would like the form to send a copy of the form to the sender. Any suggestions?

    / M

    Posted 16 years ago #
  2. yuniar

    Hi there!

    At this moment, there is no built-in feature to do this yet.
    However, with a bit of customization, we could do this.

    Here's how to do it.
    1) Get the email field name which you want the email being sent to. View source on your HTML form code. In this example, my email field name is element_3

    2) Edit includes/helper-functions.php. Around line 454, you'll find this code:

    $mail->Send();
    $mail->ClearAddresses();

    Now, right under those code, add this code:

    if(function_exists("form{$form_id}_hook_email")){
    	$carbon_email = call_user_func("form{$form_id}_hook_email",$table_data);
    	if(!empty($carbon_email)){
    		$mail->AddAddress($carbon_email);
    		$mail->Send();
    	}
    }

    3) Edit hooks/custom_hooks.php. Add this code inside of it:

    function formXXX_hook_email($user_input){
    	$field_name = 'element_3';
    
    	if(!empty($user_input[$field_name])){
    		return $user_input[$field_name];
    	}else {
    		return true;
    	}
    }


    Change the XXX with your form_id number and element_3 with your field name.

    That's it.

    If those are too difficult for you, please paste me the link to your form. I'll put up the code for you.


    MachForm Founder

    Posted 16 years ago #
  3. zentering
    Member

    WOW what a service, yes please i would like you to do it. My friend that has some skills is on holyday.

    http://www.nsph.se/index.php?aid=340

    Best regards / Z

    Posted 16 years ago #
  4. yuniar

    Ok, I've just checked your form. Your email input name is element_6

    Now, what you need to do is to paste the code as I wrote on step 2 above.
    For step no 3, use the code below:

    function form1_hook_email($user_input){
    	$field_name = 'element_6';
    
    	if(!empty($user_input[$field_name])){
    		return $user_input[$field_name];
    	}else {
    		return true;
    	}
    }


    I hope I'm being clear for you.

    If this still sounds too difficult, then mail me your FTP login information (send it to customer.service [at] appnitro.com). I'll update your files.


    MachForm Founder

    Posted 16 years ago #
  5. sloganmedia
    Member

    ok, one challenge...

    i would like, mix "send a copy (carbon)" with some "html" to 2 user (elemnt_1 and elemnet_2)

    how can i do this possible?

    Posted 16 years ago #
  6. yuniar

    Hmm..let me clarify this.

    So each user would receive one email only? which contain a mix of your form copy + some html?

    What kind of html?


    MachForm Founder

    Posted 16 years ago #
  7. sloganmedia
    Member

    Yes, i would like to do this: each user will recive one email only, (the form information entrie with a header gif (html)).

    Posted 16 years ago #
  8. sloganmedia
    Member

    Forget it, i get it, thank you anyway. :-)

    Posted 16 years ago #
  9. sub
    Member

    how did you get it?

    Posted 16 years ago #
  10. njs1970
    Member

    Hi Yuniar

    I'd like your help with this - I've just sent an email to you with the FTP info.

    Thanks

    Nick :)

    Posted 16 years ago #
  11. yuniar

    nick -- done :)


    MachForm Founder

    Posted 16 years ago #

RSS feed for this topic

Reply