Forums

Plain text option for the email

tonalt 08 May, 2008
I think it should be possible to choose plain text format for the email. Now there is html table mess and user don't have control about it at all. Columns are too wide etc.. And I don't want to change the source code.
GreyHead 09 May, 2008
Hi tonalt,

There should - but for some reason it doesn't work when we tried to change it. You'll find a thread here somewhere.

You can use an email template to control your output instead.

Bob
tonalt 12 May, 2008
Hi Bob

It seems that email template uses html table by default also. It's just one column but it's table...

I want to get control to make plain text and use tabulator characters (ASCII value 9) as separators. IMHO it looks much nicer than HTML table and all email clients understands that.
Max_admin 13 May, 2008
Hi Tonalt,

Ok, a new feature for this will be added by the next release!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tonalt 14 May, 2008
Thanks Max!
Glare 22 Jul, 2008
Hi,

any new infos? I really need to send the form in plain text.
The mail is going to our ticket system "ITSM" and it only understands plain text.

Sorry for my bad english :blush:
Glare 23 Jul, 2008
ive edited now the chronocontact.php

from
$html_message = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
						  <html>
							  <head>
								  <title></title>
								  <base href=\"JURI::base()/\" />
								  <style type=\"text/css\">
								  "."
								  </style>
							  </head>
							  <body>$html_message</body></html>";


to
 if ($mode != false){
	    $html_message = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
						  <html>
							  <head>
								  <title></title>
								  <base href=\"JURI::base()/\" />
								  <style type=\"text/css\">
								  "."
								  </style>
							  </head>
							  <body>$html_message</body></html>";
		}	


and

from
/**
	     * Send the email(s)
	     */
	    $email_sent = JUtility::sendMail($from, $fromname, $recipient, $subject, $html_message, true,
	       $ccemails, $bccemails, $attachments, $replyto_email, $replyto_name );


to
/**
	     * Send the email(s)
	     */
	    $email_sent = JUtility::sendMail($from, $fromname, $recipient, $subject, $html_message, $mode,
	       $ccemails, $bccemails, $attachments, $replyto_email, $replyto_name );


Then i set in On Submit code - before sending email:
if (!($mode == false)) {
$mode = true
};


Also i have taken all html stuff out of my template and it looks good :cheer:



Only one last, little problem: I can´t use öäü or ß in the EMail Template. If i use the code after is cutted off.
GreyHead 23 Jul, 2008
Hi Glare,

Nice, thank you.

For the öäü or ß you probably need to use html entities
Glare 23 Jul, 2008
if i use the html entities they won´t be translated, they become
GreyHead 23 Jul, 2008
Hi Glare,

Ohhhh . . . not so good, I'd forgotten that you were using plain text. Is there a character set problem? (I don't understand tham at all)

Bob
Glare 23 Jul, 2008
Hmm, i don´t think so, if i use these letters in a formfield everything is ok, but wenn i use öäü or ß in the template the rest is cut off

MyTemplate:
Folgenden User neuanlegen:
{UAnrede} {UVorname} {UName}
Eintrittsdatum (dd/mm/yyyy): {UDatum}
Abteilung: {UAbt} (Kostenstelle {UKST})
Firma: {UFirma}
geplante Durchwahl: {UTel}
Standort: {UStandort}
Berechtigungen und Freigaben:
Laufwerk N: {LW_N}
MS Office: {Office}
Lotus Notes DB Größe: {Lotus_Notes}
MS Access: {Access}
CWWS: {CWWS_A} {CWWS_S}
DataWareHouse: {DWH_A} {DWH_S}
HOST 3270: {HOST}


and after i press SAVE or APPLY it´s that:
Folgenden User neuanlegen:
{UAnrede} {UVorname} {UName}
Eintrittsdatum (dd/mm/yyyy): {UDatum}
Abteilung: {UAbt} (Kostenstelle {UKST})
Firma: {UFirma}
geplante Durchwahl: {UTel}
Standort: {UStandort}
Berechtigungen und Freigaben:
Laufwerk N: {LW_N}
MS Office: {Office}
Lotus Notes DB Gr
Glare 23 Jul, 2008
Uh, now there´s a new problem.

I´ve used this at On Submit code - before sending email:
<? $rows[0]->emailsubject = "Userneuanlage: ".$_POST['UVorname']." ".$_POST['UName']; 
if (!($mode == false)) {
$mode = true
};
?>


But now he send me as subject only what i´ve entered at the general page at EMail subject
GreyHead 23 Jul, 2008
Hi Glare,

Oh - I had though the problem was with sending the template not with saving it. I think perhaps the code has to be hacked in admin.chronocontact.php. Look for the saveChronoContact function and somewhere in there the template code has to be htmlencoded.

Bob
Max_admin 24 Jul, 2008

Uh, now there´s a new problem.



I´ve used this at On Submit code - before sending email:

<? $rows[0]->emailsubject = "Userneuanlage: ".$_POST['UVorname']." ".$_POST['UName']; 
if (!($mode == false)) {
$mode = true
};
?>




But now he send me as subject only what i´ve entered at the general page at EMail subject



Strange, put the first line alone in a new line without the PHP opening tag ?

and whats the problem with the character set ? I cant understand !!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Wunderlust 12 Aug, 2008
Hi Max,

Is there a fix for this with the two lines of code before submit. For me it is vital to have4 a plain text email and also a generated reference in the subject line as the form is read by a third party bit of software.

Thanks

TIm
Max_admin 12 Aug, 2008
Hi,

Chronoforms V3.0 BETA 1 has a plain text option for the email by default, set this in the Email properties!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.