[eluser]tmountain[/eluser]
Hi,
I have a use case where I'm sending multiple emails to different recipients in a single script execution. The email templates are rendered in this fashion:
Code:
foreach ($recipients as $recipient) {
// set $data as needed for each recipient
$message = $this->load->view("emailTemplates/$template", $data, true);
// send the message
}
I'm running into an issue with templates populating incorrectly because CI_Loader keeps old variables cached inside of $_ci_cached_vars. In some cases, this is causing recipients to receive data that isn't related to their email.
What's the best strategy for completely clearing any cached data between calls to $this->load->view()? It'd be preferable not to modify the CI source code (for obvious reasons).