Hi all,
just wondering if anyone has run into something similar:
Right now, I have an html template, which I run through juice and pass on down to SSR.compileTemplate and SSR.render, with custom data. You can see the basic outline below.
My question is this: once you start getting into large numbers of recipients, is there a better/more efficient way to handle this?
for(x=0;x<to.length;x++){
if(Contacts.find({_id:to[x]}).count() !== 0){
var recipient = Contacts.findOne({_id:to[x]});
var emailData = {
name: recipient.firstName + ' ' + recipient.lastName
};
to = recipient.email;
Email.send({
to: to,
from: from,
subject: subject,
html: SSR.render( 'htmlEmail', emailData )
});
}
}