Jump to content

[SOLVED] Email Templates From Database


steviez

Recommended Posts

Hi,

 

I need to pull my email templates from a database, the only problem is that some of the email templates will have php code in them. Is there anyway this can be done?

 

Here is a sample of one of my email templates used for registration.

 

<html>
<head>
<title>Welcome!</title>
</head>
<body>
<p>Thanks for becoming a member at ".$settings['site_name']." ".$_POST['username']."!<br />
  Your account has been set up, You need to activate your account in order to use it. Please click on the link below to activate your account<br><br>
  <a href='".$settings['site_url']."/validate/".$_POST['username']."/".$validation."'>".$settings['site_url']."/validate/".$_POST['username']."/".$validation."</a>
  </p>
  <P>Please stay tuned and keep an eye out for some new exiting features!</p>
<p>You are receiving this e-mail because you or someone else used your address to sign up on our site.<br/>If you did not sign up on our site, just ignore this message and please accept our apologies.<br/><br/>

Best regards,<br/> </p>
</body>
</html>

 

Thanks in advance

 

Link to comment
https://forums.phpfreaks.com/topic/81233-solved-email-templates-from-database/
Share on other sites

all you should have to do is echo out the database variable that contains the code (html content and/or php variables). I have used a basic php echo in a database field before and it seemed to work out ok; I never have done anything really advanced this way; but I think you should be able to accomplish this.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.