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

Need plain text


  1. joehomps
    Member

    My form data processing program will not process html data. Your simple text is still html. Is there any way that I can change the form data (email)to plain text?

    Thanks,

    Joe

    Posted 16 years ago #
  2. joehomps
    Member

    MachForm's "Simple Text" is not non-html plain text. It still has bold text and hyperlinked email address in the email.

    So how can I get rid of the "Bold" and hyperlink?

    Joe

    Posted 16 years ago #
  3. yuniar

    Try this, edit includes/helper-functions.php file.

    Search around line 363 and you'll find this block of code:

    //compose text format
    foreach ($entry_details as $data){
    
    	if(empty($data['value']) || $data['value'] == ' '){
    		continue;
    	}
    	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";
    		}
    	}else{
    		$email_body .= "<b>{$data['label']}</b> - {$data['value']} <br />\n";
    	}
    
    }


    You will need to remove all bold (<b></b>)tags from there.

    Then few lines below those block, you'll find this:

    $mail->IsHTML(true);

    change it to:

    $mail->IsHTML(false);


    MachForm Founder

    Posted 16 years ago #
  4. joehomps
    Member

    Hi, Yuniar:

    Thanks for your help. But after doing that, the email became like this:

    <div style="font-family:Lucida Grande,Tahoma,Arial,Verdana,sans-serif;font-size:12px">First Name - Joe
    Last Name - Homps
    Email - joe@msn.com
    Country - Canada
    </div>

    Posted 16 years ago #
  5. joehomps
    Member

    Sorry, the bbPress transferred the /b into line break. The original email that I got after I changed the code contains the "div style" as well as the </b>. There is no actual line breaks between the fields.

    Posted 16 years ago #
  6. yuniar

    I've just sent the file to your email. Try it please.

    Let me know if it still doesn't work either.


    MachForm Founder

    Posted 16 years ago #
  7. joehomps
    Member

    Hi, Yuniar:

    I couldn't believe someone will walk that extra mile to serve his customers. Your support is superb and very much appreciated.

    The email still contains the email address (form data) as a hyperlink and my form data processing software still can't process it. Is there any way to remove the hyperlink?

    Thanks,

    Joe

    Posted 16 years ago #
  8. joehomps
    Member

    Yuniar, thank you very much for your help. You have provided much more than a normal tech support will do. Your extra effort is very much appreciated.

    Posted 16 years ago #
  9. yuniar

    You are welcome, Joe :-)


    MachForm Founder

    Posted 16 years ago #
  10. 84R
    Member

    Do you guys care to share how this was fixed? :D

    Ive been editing helper-functions but the problem with the </ br> is still there, but there isnt anyone in the helper-functions file...?

    Best Regards,

    Charles

    Posted 15 years ago #
  11. yuniar

    Hi Charles,

    Can you send me your helper-functions.php file? I'll check it.
    Send to: customer.service [at] appnitro.com


    MachForm Founder

    Posted 15 years ago #
  12. joshgoodwin
    Member

    Did this get posted some where else?
    Im having the same problem.
    I did this step:

    $mail->IsHTML(true);
    change it to:
    $mail->IsHTML(false);

    But the <br /> is still there.

    Thanks!
    -Josh

    Posted 15 years ago #
  13. redityo

    Hi Josh,

    Have you remove all " <br>" tag in block code around line 363 ? If the "BR" still exist, could you send me your "includes/helper-functions.php" to :

    customer.service[at]appnitro.com

    i will check it


    MachForm Support

    Posted 15 years ago #
  14. joshgoodwin
    Member

    Just sent it in. Thanks for helping out!

    Posted 15 years ago #
  15. redityo

    Ok .. I got your mail, let's continue there


    MachForm Support

    Posted 15 years ago #

RSS feed for this topic

Reply