I store all outgoing emails in a database. A cron wakes up every 30 minutes to send out the next batch of emails. Up until now each of the 15 different types of email were all plain text, but I plan on moving to html based templates. Would it be more efficient to call all 15 email templates at once, even though not all of them may get used in a particular run? Or would it be more efficient to call the templates as needed in my DO WHILE loop even if that means calling certain templates over and over? Does this make sense?
$importedBody = file_get_contents('emailTemplates/hero.html');
I would pull them one at a time then cache them for later use.
As stated somewhat ambiguously by jgetner, the answer is 'neither'.
Assuming that the templates in question are not excessively large, pull them as-needed and store them in an array for reuse.
This topic is now closed. New replies are no longer allowed.