1
javier
Include html in *.tpl files??
  • 2006/11/9 22:50

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


Hi,

I want include html/advertising codes in the mails of register, notifications of new replys,etc.
But since the mail template files are *.tpl its possible to include html??

thanks in advance.
Best Regards.
javier

2
tzvook
Re: Include html in *.tpl files !!
  • 2006/11/10 7:56

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

javier wrote:
Hi,

I want include html/advertising codes in the mails of register, notifications of new replys,etc.
But since the mail template files are *.tpl its possible to include html??

thanks in advance.
Best Regards.
javier


Hello javier

It can be done quite easily if you don't have a problem messing a bit with the code.
Usually when you want to do it per module (or per system action) you need to look for the function that send the desired mail (it can be done more easily if you know which .tpl file is being sent (in whice you need html)
... so you simply make a search in the code for it's call (for instance if you use the "weblinks" module and want to change it's "approval massage" and you know that "link_approve_notify_anon.tpl" or "link_approve_notify.tpl" are being sent in this event, simply make a search in the code (I use the Homesite editor, but any editor will do of course) ... for "link_approve_notify" .. it's found at weblinks/admin/modify.php.

now you need to add one line near the call to the
$xoopsMailer->useMail();


turning it to:
$xoopsMailer->useMail();
    
$xoopsMailer->setContentType("text/html");


now, save, upload, make your tpl files HTML designed ... since line breaks won't work in them from now on...

I showed an example for weblinks "new site approval notification", but it can be easily done to almost every action, module, or any tpl file desired...

Enjoy

3
tzvook
Re: Include html in *.tpl files !!
  • 2006/11/10 8:04

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Well, if I already posted the solution for Weblinks, I'll just asy that in the latest versions of "weblinks" , there are to places to change this line in weblinks/admin/modify.php.

One is for the approval link mails (for both anon and register-members) and one for the "link refused notify".

you can change the two lines (as I show above) and not forget to make also the language email template (link_refused_notify.tpl) HTML designed too.

Hope you'll like the solution .. I do

4
javier
Re: Include html in *.tpl files??
  • 2006/11/11 19:53

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


Thanks a lot man! really appreciated!

Best regards
Javier

Login

Who's Online

445 user(s) are online (315 user(s) are browsing Support Forums)


Members: 0


Guests: 445


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