Link to home
Start Free TrialLog in
Avatar of AUCKLANDIT
AUCKLANDITFlag for New Zealand

asked on

Replace MYSQL result Varriable (email template)

Hello,

I have made some email templates which are saved as text into a MYSQL database.

I want to use these to send emails from a php signup script etc.

How can I put a $variable into the email and get it to replace that with something when it sends the email,

eg.

Email template saved in DB:

Template
____________

Hello and welcome,

your login number is $login your password is $password.

bla bla ( a long email with lots of details and things pulled from db)

______________

Email sent to user

____________

Hello and welcome,

your login number is 1213254 your password is 3243242

bla bla ( a long email with lots of details and things pulled from db)

______________


Avatar of AUCKLANDIT
AUCKLANDIT
Flag of New Zealand image

ASKER

I have tryed a few things but the mysql result is just treated like plain text using mail (.

Also the reason for needing an email template saved into the database is for easy updating as it is quite long and will require updating often.
Avatar of Guy Hengel [angelIII / a3]
you will need to show how to pass the text from the db to the email function ...
ASKER CERTIFIED SOLUTION
Avatar of nasirbest
nasirbest
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks heaps!