473,463 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to use Smarty to write a text (ex. an e-mail)?

Hallo,
I'd like to use the power of Smarty for writing an e-mail.
I mean: I have some field (or variables) and I like to create a template
of an e-mail which can be modified simply modifing the code...
like a web page whith its template.
How can I do?
Thank you in advance,
Mario.
Sep 17 '06 #1
2 1351
_mario.lat schrieb:
Hallo,
I'd like to use the power of Smarty for writing an e-mail.
I mean: I have some field (or variables) and I like to create a template
of an e-mail which can be modified simply modifing the code...
like a web page whith its template.
How can I do?
Thank you in advance,
Mario.
Write your template e.g. email.tpl
Assign the vars
$tpl -assign('Name', $name);
and fetch the Finished Template into a variable

$body=$tpl -fetch('post_view.tpl');

and then mail it

mail($to,$subject,$body);

HTH

Bernhard

--
Some humans would do anything to see if it is possible to do it.
If you would place a lager switch in some cave somewhere,
saying "END-OF-THE-WORLD-SWITCH!! DO NOT TOUCH!!!",
the paint wouldnt have time to dry.

-Terry Pratchett
Sep 17 '06 #2
_mario.lat schrieb:
Hallo,
I'd like to use the power of Smarty for writing an e-mail.
I mean: I have some field (or variables) and I like to create a template
of an e-mail which can be modified simply modifing the code...
like a web page whith its template.
How can I do?
Thank you in advance,
Mario.
Write your template e.g. email.tpl
Assign the vars
$tpl -assign('Name', $name);
and fetch the Finished Template into a variable

$body=$tpl -fetch('email.tpl');

and then mail it

mail($to,$subject,$body);

HTH

Bernhard

--
Some humans would do anything to see if it is possible to do it.
If you would place a lager switch in some cave somewhere,
saying "END-OF-THE-WORLD-SWITCH!! DO NOT TOUCH!!!",
the paint wouldnt have time to dry.

-Terry Pratchett
Sep 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Inkiniteo | last post by:
Hi guys. I have a script that sends the info by email, but i'd like to avoid the convertion to HTML by the email client or Gmail, because it ruins all the formatting i did (with tabs, mostly)....
3
by: Leo Muller | last post by:
Hi, How can I write text from code behind without getting HTML tags added to it? Up till now I used the label control. But when I call the label.text = "something" then the HTML will output...
3
by: Steven | last post by:
I am using VC++ 6.0 to build a windows based application, however, my application allows user to input command arguments in the dos prompt windows. I want to have a warning message for user if they...
2
by: xpcer | last post by:
hi friends, can anyone tell me, how to write text on status bar at browser, thanks before
1
by: harishkumar | last post by:
hi this is hari how to write the email id checking in javascript validations using in vb.net 1) if u r cecking in email id this types of message to delever to user a)(.) dot is missing b) two @...
1
by: zoehart | last post by:
I'm working with VBScript to build a text email message. I'm seeing a variety of bizarre formatting issues. The following lines of code MT = MT & vbCrLf & "Card Type: " & CardType MT = MT &...
2
by: AricC | last post by:
Does anyone know of a setting where you can write text into a combobox? I have some boxes with some info in it eg.. 1040 Rev 1111 Rev 1025 Rev I need the user to be able to add some letters...
0
by: RED | last post by:
If you market products or services online, this is a MUST have tool to success. Click here: http://tinyurl.com/2j652s How to Write Killer Email Promos that Get Results! Click here: ...
3
by: Fabian Braennstroem | last post by:
Hi, I would like to write text directly to the clipboard of linux using some c++ lines. Would be nice, if anyone has a suggestion, how to do this. Thanks! Greetings! Fabian
4
by: aeris | last post by:
Hello! I'm using C# to doing my window application. May I ask, how to write text on textbox after the default text is clear? I have setted the default text in textbox, when a user click on it,...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.