AUCKLANDIT
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)
______________
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)
______________
you will need to show how to pass the text from the db to the email function ...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks heaps!
ASKER
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.