Current location: Hot Scripts Forums » Programming Languages » PHP » eMailing Smarty Templates


eMailing Smarty Templates

Reply
  #1 (permalink)  
Old 12-31-04, 07:14 AM
bilco105 bilco105 is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
eMailing Smarty Templates

Hi Guys,

I'm in the middle of writing a rather large script and have been using smarty for the html side of it.

I'm trying to keep all forms of output seperate from the processing stuff...

However, Its got to the point where I need the script to send out a few emails with variables in them.

I don't want to hard-code these emails into the actual script, as this would defeat the object of smarty.

So, does anyone know a method of emailing a smarty template. Or some other form of emailing stuff from a seperate file?

Smarty is preferered however

Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 12-31-04, 11:42 AM
jsjohnst's Avatar
jsjohnst jsjohnst is offline
Coding Addict
 
Join Date: Oct 2003
Location: Overland Park, KS
Posts: 309
Thanks: 0
Thanked 0 Times in 0 Posts
Great choice on using Smarty. I have been using it for a while (even used it when I developed the new Hotscripts released last September) and simply love it. What you are wanting to do is completely possible, all you need to do is instead of calling the display() method of the Smarty class, call the fetch() method.

More information can be found here:
http://smarty.php.net/manual/en/api.fetch.php
__________________
Jeremy Johnstone
Personal Blog: http://www.jeremyjohnstone.com/blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 12-31-04, 11:44 AM
jsjohnst's Avatar
jsjohnst jsjohnst is offline
Coding Addict
 
Join Date: Oct 2003
Location: Overland Park, KS
Posts: 309
Thanks: 0
Thanked 0 Times in 0 Posts
Also, would mention that if I were you I would look into using the htmlMimeMail class (believe it's in PEAR) for email sending instead of PHP's mail() function even if you only sending plain text emails. It's mail sending is a lot more robust and flexible, so I would highly recommend it anytime your needing to send outbound mail.
__________________
Jeremy Johnstone
Personal Blog: http://www.jeremyjohnstone.com/blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 01-01-05, 12:56 PM
bilco105 bilco105 is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Worked perfectly, Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
osCommerce skins, oscommerce templates, osCommerce themes algozone General Advertisements 4 02-24-05 02:53 AM
Free Popular Php-Nuke Themes & phpBB themes forum templates trushkin General Advertisements 0 10-22-04 03:42 PM
Variables from templates in the database dannyallen PHP 0 06-28-04 04:49 PM
Custom Graphic Design, Logo Templates, WebSite Templates, Royalty Free Server Images. A1future General Advertisements 1 06-20-04 06:50 AM


All times are GMT -5. The time now is 06:43 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.