Public Function send ()
{
$ Emailtemplate = Mage: GetModel ('Core/email_template ');
// Send all emails from corresponding list
While (! Empty ($ this-> _ emailinfos )){
$ Emailinfo = array_pop ($ this-> _ emailinfos );
// Handle "BCC" policients of the current email
$ Emailtemplate-> addbcc ($ emailinfo-> getbccemails ());
// Set required design parameters and delegate email sending to mage_core_model_email_template
$ Emailtemplate-> setdesignconfig (Array ('area '=> 'frontend', 'store' => $ this-> getstoreid ()))
-> Sendtransactional (
$ This-> gettemplateid (),
$ This-> getsender (),
$ Emailinfo-> gettoemails (),
$ Emailinfo-> gettonames (),
$ This-> gettemplateparams (),
$ This-> getstoreid ()
);
}
Return $ this;
}
(1) $ this-> gettemplateid ()
<Global>
<Template>
<Email>
<Customer_create_account_email_template translate = "label" module = "customer">
<Label> New Account </label>
<File> account_new.html </File>
<Type> HTML </type>
</Customer_create_account_email_template>
</Email>
/ span>
$ This-> gettemplateid () indicatesCustomer_create_account_email_template.
(2) $ this-> getstoreid ()
The system will$ This-> getstoreid ()To call different mail templates under locale. By default, the APP/locale/en_us/template/EmailEmail template
(3) $ this-> gettemplateparams ()
the variables in the email template all come from this