I'm not sure how to go about doing this, but this is what I want to do:
I have an application that tracks my customers' domain registrations. It sends them an email notification that their registration will soon be expiring.
Here's what I want to do --
Read the MySQL and determine if any domains will expire in <31 days. Possible results are: 0, 1, >1
In preparing this, I will need to build an email template. This is done and works correctly.
BUT -- I also want to display the results on the screen, so I want to build two templates simultaneously ... one to display what is happening and the other to build an email for each record found.
I imagine that TBS can do this, I just don't know how to go about it.
In preparing the email template, I use:
$TBS->LoadTemplate('includes/emailnotice.tpl.html');
$TBS->MergeBlock('blk','tbssql','SELECT statement...');
$messageBody = $TBS->Show(TBS_OUTPUT); |
Is this correct?
I think I can prepare the two templates using something like this:
$TBS->MergeBlock('blk1,blk2','tbssql','SELECT * FROM MyTable'); |
Do I have the right idea? How does one load two templates at the same time?
The only other issue I see if that I need to send an email for each record found (1 or >1) but I see the danger that possibly all records would be dumped into a single email, so I'm looking to avoid that possibility as I get this to work.
I can use any suggestions and recommendations on how to best solve this problem.