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

Sending email from checkboxes


  1. Saghalie
    Pro Member

    Hello,
    I followed the info given in this topic:
    http://www.appnitro.com/forums/topic/email-from-a-drop-downlist/page/2
    and the information in there is no longer valid for v2.3 - includes/helper-functions.php does not have the if($target_is_admin){if(function_exists("form{$form_id}_hook_email")){
    code anymore.

    I was wondering if it is still possible?

    If so can you tell me where to go and what to do?

    Thanks!

    Saghalie
    http://www.kcmhosting.com

    Posted 12 years ago #
  2. redityo

    The code does not exist in the "helper-functions.php" file indeed, you need to add the code first. The instruction is on page 1.
    Around line 478 in helper-functions.php file, you will see these code :

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

    then you can add these code exactly bellow that code

    if($target_is_admin){
    
    if(function_exists("form{$form_id}_hook_email")){
    
    	$carbon_param['form_id'] = $form_id;
    	$carbon_param['entry_id'] = $entry_id;
    	$carbon_email = call_user_func("form{$form_id}_hook_email",$carbon_param);
    
    	if(!empty($carbon_email)){
    			$email_address 	= explode(',',$carbon_email);
    
    			foreach ($email_address as $email){
    				$email = trim($email);
    				if(!empty($email)){
    					$mail->AddAddress($email);
    					$has_email = true;
    
    				}
    			}
    			$mail->Send();
    			$mail->ClearAddresses();
    		}
    	}
    }

    MachForm Support

    Posted 12 years ago #
  3. Saghalie
    Pro Member

    The information on page one is for drop downs and while the code executes, I do not get the emails that I have configured for it. Is it because of the drop down code? Is there a different code for radio buttons?

    I saw an article here about radio buttons and to do a select operation on the database for (example) element_3_1,element_3_2 (etc.) but the database (as you know) does not contain information about the elements for radio buttons with the exception of field values. But for some reason it is not picking those values up and assigning the email address.

    Possibly that old article was for a previous version? Is there updated code for this?

    Regards,

    Saghalie
    http://www.kcmhosting.com

    Posted 12 years ago #
  4. Saghalie
    Pro Member

    I got it working. I had to enable notifications (I put a no-reply@ address in there). Works great!

    Thanks!

    Regards,

    Saghalie
    http://www.kcmhosting.com

    Posted 12 years ago #

RSS feed for this topic

Reply