Re: Re[2]: [PHP] variables in a e-mail

2001-06-20 Thread Alexander Wagner

Hiho,

Richard Kurth wrote:
 Hello Alexander,
 This is pretty much what I want to do. I want to have a e-mail script
 in my application and have it so the user can customize the e-mail that
 is sent out in a configure file. Say he wants to send a recurring bill
 to his customers and he wants it to look a certain way. He would design
 the e-mail using placeholders and the it would be processed and the data
 would be filled in. Do you know of any examples of this in any program
 that is out there. I do better when I can see complete examples to be
 able to get the full picture

I, personally, know only one, which you won't be able to look at, unless you 
pay the rather high price, and even then, you'd be buggered by german 
source-comments.
Well, I think what you have to do is clear:
Get a template with the placeholders in, this is what the user has to provide.
Find out who shall recieve this mail, and get data about them (name, how much 
they paid or whatever you use those bills for). Then do the replacements once 
and present the user a preview of the mail, so he can be sure hi didn't 
mispell any placeholders.
If he still wants to send the mails, send each reciever a mail, and do the 
replacements every time. That should do it.

regards
Wagner

-- 
Isn't it strange? The same people who laugh at gypsy fortune tellers take 
economists seriously.
 - Cincinnati Enquirer   



RE: Re[2]: [PHP] variables in a e-mail

2001-06-19 Thread Bruin, Bolke de

Use templates

instead of sending it to the webbrowser send it as an email...

http://www.phpbuilder.com for more info



-Oorspronkelijk bericht-
Van: Richard Kurth [mailto:[EMAIL PROTECTED]]
Verzonden: Tuesday, June 19, 2001 4:51 AM
Aan: [EMAIL PROTECTED]; Alexander Wagner
Onderwerp: Re[2]: [PHP] variables in a e-mail


Hello Alexander,
This is pretty much what I want to do. I want to have a e-mail script
in my application and have it so the user can customize the e-mail that
is sent out in a configure file. Say he wants to send a recurring bill
to his customers and he wants it to look a certain way. He would design
the e-mail using placeholders and the it would be processed and the data
would be filled in. Do you know of any examples of this in any program
that is out there. I do better when I can see complete examples to be
able to get the full picture

Monday, June 18, 2001, 4:01:45 PM, you wrote:

Alexander Wagner Hiho,

Alexander Wagner Richard Kurth wrote:
 How can I add a variable to an e-mail on the fly. Say I have a form on
 my page that the user fells in with data. but when he fills in the
 message things like Hello,$Variable are added before it is sent. Does
 this make sence

Alexander Wagner Of course it does.
Alexander Wagner However, variables are not the way to go. The mails are
not parsed, so 
Alexander Wagner variables won't do you any good. You'll have to use
Placeholders. Something 
Alexander Wagner like this:

Alexander Wagner $mail_template = 
Alexander Wagner Hi ##firstname## ##lastname##,
Alexander Wagner how are you...;

Alexander Wagner Now you can continue with str_replace():
Alexander Wagner $mail_content =
str_replace('##firstname##',$fname,$mail_template);
Alexander Wagner $mail_content =
str_replace('##lastname##',$lname,$mail_content);

Alexander Wagner regards
Alexander Wagner Wagner




-- 
Best regards,
 Richard  
mailto:[EMAIL PROTECTED]