xoops forums

tzvook

Just can't stay away
Posted on: 2006/5/17 14:31
tzvook
tzvook (Show more)
Just can't stay away
Posts: 854
Since: 2003/2/1 2
#11

Re: send email with html to site members

OK ... found the little error in it: ( missed the 'name'=>'description' before )

the full code for mailform.php (line 82) should be:

include_once(XOOPS_ROOT_PATH "/class/xoopseditor/inbetween/forminbetweentextarea.php");
$body_text = (new XoopsFormInbetweenTextArea(array('caption'=> $body_caption'name'=>'mail_body''value'=>$mail_body'width'=>'100%''height'=>'250px'),true));



So now as far as I tested all if fine and hack is great.
I would really like to get more test reports, though I tested it quite a bit under 2.2.3 , and inbetween is functioning well in here ... pictures path, smilies ... all is good ....

I think it'll be a nice addition to the core ( 2.2.5 ... ??? ... phppp ? ) ... with a wysiwyg selection box and all .... after all it's a long awaited option for a lot of users

sceilig

Just popping in
Posted on: 2006/5/17 18:23
sceilig
sceilig (Show more)
Just popping in
Posts: 53
Since: 2006/3/1 1
#12

Re: send email with html to site members

Glad to hear your were able to implement it tzvook and thanks for testing.
I do see one issue which is that if you also select to have the message sent as a private message, the PM wont show the content of the message correctly (shows as straight html). I have looked at the PM module and its object handler but cant see where the html characters in the message are being translated to their character entities. The database stores the private message correctly as straight html - but doesnt when it renders to the readpmsg.php?

I also decided to use the evennews module, and the hack to get that to work with html emails would be here:

modules/evennews/admin/index.php
In the sendMessage() function just after
$xoopsMailer = &getMailer();

Quote:

$xoopsMailer->setContentType("text/html");
$xoopsMailer->setTemplate('mailusers.tpl');
$xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']);
$xoopsMailer->assign('X_SITEURL', XOOPS_URL."/");
$xoopsMailer->assign('X_MESSAGE', $mail_mess);


Of course you would need a html editor like inbetween in your messageForm function (not sure of the line number since Ive hacked this module quite a lot).
Quote:

include_once XOOPS_ROOT_PATH . "/class/xoopseditor/inbetween/forminbetweentextarea.php";
$sform->addElement(new XoopsFormInbetweenTextArea(array('caption'=> _ADM_EVENNEWS_MESSAGE, 'name'=>'mail_mess', 'value'=>$mainemailbodytext, 'width'=>'100%', 'height'=>'250px'),true));

tzvook

Just can't stay away
Posted on: 2006/5/17 18:45
tzvook
tzvook (Show more)
Just can't stay away
Posts: 854
Since: 2003/2/1 2
#13

Re: send email with html to site members

Are you using evennews with the 2.2.x series ?

sceilig

Just popping in
Posted on: 2006/5/17 19:24
sceilig
sceilig (Show more)
Just popping in
Posts: 53
Since: 2006/3/1 1
#14

Re: send email with html to site members

Im using Evennews v2.1 on XOOPS 2.2.4

I also wondered about the templating system in Evennews - there seems to be a section commented out. Perhaps in a previous version you could choose mail templates to use?
The commented out section is just after the Subject row in the messageForm function.

tzvook

Just can't stay away
Posted on: 2006/5/17 20:13
tzvook
tzvook (Show more)
Just can't stay away
Posts: 854
Since: 2003/2/1 2
#15

Re: send email with html to site members

Actually I kind of gave up evenews due to the problems importing a large no. of users (starts the problems from about 1500 users) .... take a look @ here: https://xoops.org/modules/newbb/viewto ... de=flat&order=ASC&start=0

tzvook

Just can't stay away
Posted on: 2006/10/25 16:47
tzvook
tzvook (Show more)
Just can't stay away
Posts: 854
Since: 2003/2/1 2
#16

Re: send email with html to site members

I just now realised (with a new site I made) that since I send HTML nitifications, the users that chose to get nitified by PM get the html tags in the mail I send.

I searched the forum for a few hours and can't find any hack for that one ... if somebody made this hack ... please post, if not, I'll start digging again at the PM module ( I use XOOPS 2.2.3 )

tzvook

Just can't stay away
Posted on: 2006/10/29 13:36
tzvook
tzvook (Show more)
Just can't stay away
Posts: 854
Since: 2003/2/1 2
#17

enable html in PM's

As happens a lot lately, I have to answer myself

Quite easy actually (after chasing it for 2 days) ...

Open /modules/pm/class/privmessage.php and look for the line:

$this->initVar('msg_text'XOBJ_DTYPE_TXTAREAnulltrue);


Add after this line:
// Tzvook hacked for HTML massages //
        
$this->initVar("dohtml"XOBJ_DTYPE_INT1false);
// Tzvook hacked for HTML massages //


Found Problems .... PM can't be sent now .... ... but solution got to be close ...

Any clue ..... somebody ??????

tzvook

Just can't stay away
Posted on: 2006/10/30 7:01
tzvook
tzvook (Show more)
Just can't stay away
Posts: 854
Since: 2003/2/1 2
#18

Re: enable html in PM's

BUMP

Someone ????? .... what's wrong with my hack ???

It do the Work , but gives ERRORS when sending PM's ????????
(missing something) .....

????

tzvook

Just can't stay away
Posted on: 2006/10/31 14:13
tzvook
tzvook (Show more)
Just can't stay away
Posts: 854
Since: 2003/2/1 2
#19

Re: enable html in PM's

LAST bump ....
No one sees my mistake ?

tzvook

Just can't stay away
Posted on: 2006/11/2 15:31
tzvook
tzvook (Show more)
Just can't stay away
Posts: 854
Since: 2003/2/1 2
#20

Re: enable html in PM's

Had to replace the line with
$this->initVar('msg_text'XOBJ_DTYPE_OTHERnulltrue);


Which is quite unsfe to do, but works !!! HTML is ok and PM is working !!!

probably an "unserialize" is needed here, but I don't know how to do it...