1
Shine
Liaise 1.26, need help with a bit of code...
  • 2007/12/29 8:45

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Can somebody help me out.
I am busy to realise a automatic reply message (which is an exact copy of the submitted form) to the sender.
It already works, but with one piece of code I am totally stuck.
I would like that the script apart from opening and closing the php tag \n (which is the breaktag) also the bold tag opens and closes.
Example:
Name: Jerry
Age: 17

I have tried the code below, but it doesnt work. Within the received template I get the html tags < b > instead of the bold text
$msg[$ele_id] = "SLASHn ".$myts->stripSlashesGPC($ele_caption).": ";


What is wrong within this code and what should be entered to get this working?

(I needed to enter the word SLASH otherwise the code doesn't show right in my presented example in this forum. In fact the word SLASH represents the symbol \ )

2
Quest
Re: Liaise 1.26, need help with a bit of code...
  • 2007/12/29 9:00

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


From what little I know about such things, I am having difficulty understanding from what I see, just exactly what is it you want bold? I am thinking you want the : in bold. If that is the case and it were me then I would try something like:

Take out the after the "Slashn".
Add the in front of the : like this
":

Otherwise just disregard what I am saying because it is 4am in the morning and I am 3/4 asleep. :)

Happy New Year to you and yours.

Quest

3
Shine
Re: Liaise 1.26, need help with a bit of code...
  • 2007/12/29 9:08

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Cannot be done because then the result would be:
Name: Jerry
Age: 17
See the difference?

The part
($ele_caption)
renders the formfield Name, Age (fields I have created and users should be entered)
and these fields (not the given answers) I would like to have be bold.

4
Quest
Re: Liaise 1.26, need help with a bit of code...
  • 2007/12/29 9:14

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


Gotcha. I do see the difference now. I'll do some looking around to see if can come up with a possible solution to the agonizing < b >.

Quest

5
Catzwolf
Re: Liaise 1.26, need help with a bit of code...
  • 2007/12/29 14:04

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Hiya Shine,

Can you give me a little more information before I can help you on this? Is this an email that you are trying to send out or a PM?

edit:

nevermind :)

Can you tell which file you are trying to edit?

Catz

6
Catzwolf
Re: Liaise 1.26, need help with a bit of code...
  • 2007/12/29 14:20

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Ok shine found a fix for you on this one. I think lol

Open XOOPS_ROOT/modules/liaise/include/form_execute.php and around line 239:

$xoopsMailer->useMail();
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);


change to the following:
$xoopsMailer->useMail();
$xoopsMailer->multimailer->IsHTML(true);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);


What this will do is send out your emails as html rather than just plain text.

Let me know if it works?

Catz

7
Shine
Re: Liaise 1.26, need help with a bit of code...
  • 2007/12/29 23:48

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Quote:
Can you give me a little more information before I can help you on this? Is this an email that you are trying to send out or a PM?

Nevertheless I will give you some more information...

As you know Liaise is a module where you can create easily forms. You can set your own fields, required or not etc. etc.
If the user who entered or answered the fields pushes the send button, the admin (in my settings!) wil receive this form with entered answers. But, I want that the user, read person who submitted the form gets a replica/copy of that submitted form.

A guy named Matt got it working on his site and I contacted him. He nicely sended me his files and I installed it all. But unfortunately it didn't work out properly. So I digged into the code to see what needed to be changed to get it working. Some pieces I needed to left out to get it working properly.

And yes....All nessecary changes needed to be done within: include/form_execute.php

Prox line 279, the changes are taken place.......
$xoopsMailer->assign("MSG"implode("n"$msg));
//INSERT SHINE CONFIRMATION MAIL
$xoopsMailer->assign("MSG2"sprintf(_LIAISE_MSG_SUBJECT$myts->stripSlashesGPC($form->getVar('form_title'))));
// END INSERT SHINE CONFIRMATION MAIL

if( count($err) < ){
    if( !
$xoopsMailer->send(true) ){
        
$err[] = $xoopsMailer->getErrors();
    }
}
//INSERT SHINE CONFIRMATION MAIL
if( empty($err) && $xoopsMailer->isMail && isset($reply_mail) ){
    
$xoopsMailer->multimailer->ClearReplyTos();
    
$xoopsMailer->multimailer->ClearAttachments();
    
//$formTitle=getVar('form_title');
    //$body=$formTitle;
    
$body=" Dit is een automatische verzonden bevestigings Email naar aanleiding van het door u ingestuurde formulier op Kunstpodium.com. Gelieve niet op deze Email te antwoorden.nU hebt onderstaand formulier ingestuurd.nn";
    
$formTitle=sprintf(_LIAISE_MSG_SUBJECT$myts->stripSlashesGPC($form->getVar('form_title')));
    
$body.="Form: ";
    
$body.=$formTitle;
    
//$body.="

";
    
$body.=implode("",$msg);
    
$body.=" nnIndien u een geldig Emailadres hebt ingevuld zult u binnen 14 dagen een antwoord ontvangen.n Met vriendelijke groetnn Administratorn www.kunstpodium.comn";
    
//$body .= $myts;
    
$xoopsMailer->sendMail($reply_mail"Kunstpodium bevestigings Email"$body$xoopsMailer->headers);
}
// END INSERT SHINE CONFIRMATION MAIL

As you can see the start text within the replica/copy to sender email is hardcoded (I prefer to realise it with a separate template, but don't know enough how to realise this. Therefore.....hardcoded.

As I understand your oneline code, will solve the [bold] issue? And I can leave my added piece of code in this line also?:

$msg[$ele_id] = "SLASHn ".$myts->stripSlashesGPC($ele_caption).": ";


Last and least......
Quote:
What this will do is send out your emails as html rather than just plain text

What happens if the person has the setting no HTML email within his outlook, but just plain text?
How does the replica/copy email looks if he/she opens it?

Catz, in advance,.......thanks for your kind help!

Grtz., Shine

Happyieieieyyeeeaa,.........2008

8
Catzwolf
Re: Liaise 1.26, need help with a bit of code...
  • 2007/12/30 12:52

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Quote:
What happens if the person has the setting no HTML email within his outlook, but just plain text?
How does the replica/copy email looks if he/she opens it?


I guess they will just see html rather than plain text.

You could actually put in the form whether or not the recipient would like a copy of the form in plain text or html
$xoopsMailer->useMail();
$ret = ( $form->getVar('form_ishtml') ) ? trueyes;
$xoopsMailer->multimailer->IsHTML$ret );
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);


The $form->getVar('form_ishtml') would have to be a value you stated in the form. (Hope you know what I mean by this? lol)

Catz

Login

Who's Online

348 user(s) are online (262 user(s) are browsing Support Forums)


Members: 0


Guests: 348


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits