Plain text option for the email

Please post your suggestions or any hacks you have made here

Plain text option for the email

Postby tonalt on Thu May 08, 2008 2:06 pm

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.
tonalt
Fresh Boarder
Fresh Boarder
 
Posts: 4
Joined: Thu May 08, 2008 1:47 pm

Re:Plain text option for the email

Postby GreyHead on Fri May 09, 2008 7:57 pm

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
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
Platinum Boarder
 
Posts: 2965
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Plain text option for the email

Postby tonalt on Mon May 12, 2008 7:22 am

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.
tonalt
Fresh Boarder
Fresh Boarder
 
Posts: 4
Joined: Thu May 08, 2008 1:47 pm

Re:Plain text option for the email

Postby admin on Tue May 13, 2008 2:58 pm

Hi Tonalt,

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

Cheers

Max
ChronoForms Developer Thanks for using ChronoForms.
If you have any problems with ChronoForms please tell us.
If you like ChronoForms please post a review at Joomla.org
User avatar
admin
Platinum Boarder
Platinum Boarder
 
Posts: 1659
Joined: Mon Aug 14, 2006 5:29 am

Re:Plain text option for the email

Postby tonalt on Wed May 14, 2008 7:47 am

Thanks Max!
tonalt
Fresh Boarder
Fresh Boarder
 
Posts: 4
Joined: Thu May 08, 2008 1:47 pm

Re:Plain text option for the email

Postby Glare on Tue Jul 22, 2008 4:23 pm

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
Fresh Boarder
Fresh Boarder
 
Posts: 5
Joined: Tue Jul 22, 2008 4:07 pm

Re:Plain text option for the email

Postby Glare on Wed Jul 23, 2008 7:26 am

ive edited now the chronocontact.php

from
Code: Select all
$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
Code: Select all
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
Code: Select all
/**
        * Send the email(s)
        */
       $email_sent = JUtility::sendMail($from, $fromname, $recipient, $subject, $html_message, true,
          $ccemails, $bccemails, $attachments, $replyto_email, $replyto_name );


to
Code: Select all
/**
        * 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:
Code: Select all
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.
Glare
Fresh Boarder
Fresh Boarder
 
Posts: 5
Joined: Tue Jul 22, 2008 4:07 pm

Re:Plain text option for the email

Postby GreyHead on Wed Jul 23, 2008 10:39 am

Hi Glare,

Nice, thank you.

For the öäü or ß you probably need to use html entities ö ä ü and ß

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
Platinum Boarder
 
Posts: 2965
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Plain text option for the email

Postby Glare on Wed Jul 23, 2008 10:54 am

if i use the html entities they won´t be translated, they become ö in the mail too.

for example: i use in the Template "Lotus Notes Größe (Größe)" and become in the mail the same.
Glare
Fresh Boarder
Fresh Boarder
 
Posts: 5
Joined: Tue Jul 22, 2008 4:07 pm

Re:Plain text option for the email

Postby GreyHead on Wed Jul 23, 2008 11:04 am

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
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
Platinum Boarder
 
Posts: 2965
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Plain text option for the email

Postby Glare on Wed Jul 23, 2008 11:30 am

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:
Code: Select all
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:
Code: Select all
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
Fresh Boarder
Fresh Boarder
 
Posts: 5
Joined: Tue Jul 22, 2008 4:07 pm

Re:Plain text option for the email

Postby Glare on Wed Jul 23, 2008 12:28 pm

Uh, now there´s a new problem.

I´ve used this at On Submit code - before sending email:
Code: Select all
<? $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
Glare
Fresh Boarder
Fresh Boarder
 
Posts: 5
Joined: Tue Jul 22, 2008 4:07 pm

Re:Plain text option for the email

Postby GreyHead on Wed Jul 23, 2008 12:36 pm

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
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
Platinum Boarder
 
Posts: 2965
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re: Plain text option for the email

Postby admin on Thu Jul 24, 2008 10:27 pm

Glare wrote:Uh, now there´s a new problem.



I´ve used this at On Submit code - before sending email:
Code: Select all
<? $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
ChronoForms Developer Thanks for using ChronoForms.
If you have any problems with ChronoForms please tell us.
If you like ChronoForms please post a review at Joomla.org
User avatar
admin
Platinum Boarder
Platinum Boarder
 
Posts: 1659
Joined: Mon Aug 14, 2006 5:29 am


Return to Suggestions & Hacks

Who is online

Users browsing this forum: No registered users and 1 guest