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

Emails received


  1. reprocessor
    Member

    Hi Guys,

    I need to know urgently if you can make the email address in the received email a link i.e. have a 'mailto:' function put on it. Which file would I need to edit?

    With kind regards,

    Phil

    Posted 16 years ago #
  2. redityo

    Hi ..

    You can edit "helper-functions.php" file to make this modification

    1. insert this code below line 351 :

    } elseif ($data['element_type'] == 'email') {
    	$data['value'] = '<a href="mailto:' .
    	$data['value'] . '">' . $data['value'] . '</a>';
    	$data['value'] = strip_tags($data['value'],'<a>');
    }

    2. Edit code between line 369 ~ 383 :

    From :

    if($data['element_type'] == 'textarea'){
    	$email_body .= "<b>{$data['label']}</b> ".nl2br($data['value'])."\n";
    }elseif ($data['element_type'] == 'checkbox' || $data['element_type'] == 'address'){
    	$email_body .= "<b>{$data['label']}</b> ".$data['value']."\n";
    }elseif ($data['element_type'] == 'file'){
    	if($target_is_admin === false){
    		$data['value'] = strip_tags($data['value']);
    		$email_body .= "<b>{$data['label']}</b> - {$data['value']} \n";
    	}else{
    		$data['value'] = strip_tags($data['value'],'<a>');
    		$email_body .= "<b>{$data['label']}</b> ".$data['value']."\n";
    	}
    }else{
    	$email_body .= "<b>{$data['label']}</b> - {$data['value']} \n";
    }

    to

    if($data['element_type'] == 'textarea'){
    	$email_body .= "<b>{$data['label']}</b> <br />".nl2br($data['value'])."<br /><br />\n";
    }elseif ($data['element_type'] == 'checkbox' || $data['element_type'] == 'address'){
    	$email_body .= "<b>{$data['label']}</b> <br />".$data['value']."<br /><br />\n";
    }elseif ($data['element_type'] == 'file'){
    	if($target_is_admin === false){
    		$data['value'] = strip_tags($data['value']);
    		$email_body .= "<b>{$data['label']}</b> - {$data['value']} <br />\n";
    	}else{
    		$data['value'] = strip_tags($data['value'],'<a>');
    		$email_body .= "<b>{$data['label']}</b> <br />".$data['value']."<br /><br />\n";
    	}
    } elseif ($data['element_type'] == 'email') { // here is the change
    	$data['value'] = '<a href="mailto:' . $data['value'] . '">' . $data['value'] . '</a>';
    	$email_body .= "<b>{$data['label']}</b> - {$data['value']} <br />\n";
    }else{
    	$email_body .= "<b>{$data['label']}</b> - {$data['value']} <br />\n";
    }

    MachForm Support

    Posted 16 years ago #
  3. AMurray
    Pro Member

    I don't know if that's actually set up in Machform, it should occur by default.

    I suspect it will only occur if you have your email client to viewing HTML format messages (in plain text your mail program may or may not show the link - as seems to be the case for you).

    On my system (Vista Ultimate, Outlook 2007) I can see the form's email and it does have a link in the body of the message a "mailto" link back to the person who submitted it.

    Posted 16 years ago #
  4. reprocessor
    Member

    Thanks guys - that's it sorted.

    AMurray - thanks for letting me know this i thought that might be the case but I need to cover all bases. I haven't had the time to test on thunderbird yet but the mail doesn't show the email link in windows mail on the vista home package.

    My site is directed at home users and small businesses so I need to 'idiot proof' it, if you know what I mean ;)

    Cheers,

    Phil

    Posted 16 years ago #

RSS feed for this topic

Reply