Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
7 - 3 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
contentType = trim($value); } // END TZ Addition // [/code] 3. in the same file around line 420 (just after ($this->encoding) [code] // TZ added for HTML mailing // $this->multimailer->ContentType = $this->contentType; // END TZ Addition // [/code] 4. Now depending on what module you are using for sending emails to users, you add a couple of fields to your $xoopsMailer instance. e.g. for sending html emails using the main "Mail Users" administration function, edit this file: modules/system/admin/mailusers/mailusers.php At line 147 ( $xoopsMailer =& xoops_getMailer(); ) add this lines: [code] // TZ added for HTML mailing // $xoopsMailer->setContentType("text/html"); $xoopsMailer->setTemplate('mailusers.tpl'); $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']); $xoopsMailer->assign('X_SITEURL', XOOPS_URL."/"); $xoopsMailer->assign('X_MESSAGE', $myts->oopsStripSlashesGPC($_POST['mail_body'])); // END TZ Addition // [/code] What Im doing here is setting the ContentType to be text/html. Then using a mail template I created called 'mailusers.tpl'. This template (stored in language/english/mail_template/) is essentially a html file containing my website header and footer, as well as XOOPS placeholders for the content of the email (X_MESSAGE) and Name of the website. This would be a simple example of that template: Quote: {X_MESSAGE} ------------------------------------- Please do not reply to this message. ------------------------------------- {X_SITENAME} {X_SITEURL} ================================================================= 5. Implement a html editor for creating the body of the email like inbetween or fckeditor. For the "Mail Users" function, you would edit modules/system/admin/mailusers/mailform.php then uncomment line 82 ($body_text = new XoopsFormTextArea ......) and put this call to the Inbetween editor instead [code] // TZ added for HTML mailing // 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)); // END TZ Addition // [/code] for tinyeditor turn it into: [code] // $body_text = new XoopsFormTextArea($body_caption, "mail_body", "", 10); // TZ added for HTML mailing // include_once(XOOPS_ROOT_PATH . "/class/xoopseditor/tinyeditor/formtinyeditortextarea.php"); $body_text = (new XoopsFormtinyeditorTextArea(array('caption'=> $body_caption, 'name'=>'mail_body', 'value'=>$mail_body, 'width'=>'100%', 'height'=>'250px'),true)); // END TZ Addition // [/code] NOW - a call to devs - I "cleaned the dust" after 3 years from the original thread, please !!! add it to the core !!! I can't see my sites without this hack and am tired to apply it to each version that comes out - it a must have one and ... well enough said ... as said b4 - If not intended to the core - I plan to add system-wide editors to this ... [b]For small to medium sites - this hack is upgrading the mail-users features quite nicely instead of a mailinglist.[/b] [/quote]" />

Re: Using HTML in Mail Users under System?
by cgunther on 2011/1/25 4:14:09

Again, please add this to core feature requests.

Thanks Sooooooo Much in advance.
Re: Using HTML in Mail Users under System?
by cgunther on 2011/1/25 3:59:58

I tried this on 2.5.0 with no luck, still text only email.


XOOPS Version XOOPS 2.5.0
PHP Version 5.2.15
mySQL Version 5.1.52
Server API cgi-fcgi
OS Linux
safe_mode Off
register_globals Off
magic_quotes_gpc On
allow_url_fopen Off
fsockopen On
post_max_size 1024M
max_input_time 60
output_buffering
max_execution_time 30
memory_limit 64M
file_uploads On
upload_max_filesize 64M

tvzook - maybe have another look? I am trying with fckeditor but would be happy with anything.
Re: Using HTML in Mail Users under System?
by ghia on 2009/9/20 7:43:25

Stick to 2.3.3b, 2.4.0 is only for test.

Do the file check (see release notes).
Re: Using HTML in Mail Users under System?
by Sama on 2009/9/20 7:19:33

Var mail_body no define this is a error.

and i have a problem to change to 2.4.0 is no posible.

Notice: Undefined variable: mail_body in file /modules/system/admin/mailusers/mailform.php line 87
Queries
SET NAMES 'latin1'
SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC
SELECT sess_data, sess_ip FROM session WHERE sess_id = '027f60a0d483b22ef645aa3d2ed336e0'
SELECT * FROM users WHERE uid = '4'
SELECT * FROM modules WHERE dirname = 'system'
SELECT * FROM modules WHERE (hasadmin = '1' AND isactive = '1') ORDER BY weight ASC, mid ASC
SELECT * FROM modules WHERE dirname = 'news'
SELECT * FROM config WHERE (conf_modid = '6') ORDER BY conf_order ASC
SHOW TABLES
SELECT * FROM weblinks_config2 ORDER BY conf_id ASC
SELECT * FROM weblinks_category WHERE pid=0 ORDER BY orders, cid
SELECT * FROM groups WHERE groupid != '3'
Total: 12 queries
Blocks
Total: 0 blocks
Extra
Token Validation: No valid token found in request/session
Included files: 123 files
Memory usage: 4844032 bytes
Timers
XOOPS took 0.121 seconds to load.
XOOPS Boot took 0.028 seconds to load.
Module init took 0.093 seconds to load.
Re: Using HTML in Mail Users under System?
by tzvook on 2009/9/19 7:43:50

@ Sama
Quote:
Sama wrote:
I have v2.3.3, but i get a blank page on admin module message, i use inbetween.

System vars will help here + debug info

@ Mazarin
Quote:
Will this make it into 2.4.0?

Try and see
Should work I think, if not - we'll try to deal with it ....

Who's Online

184 user(s) are online (154 user(s) are browsing Support Forums)


Members: 0


Guests: 184


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits