Magento - sending email programmatically - some unanswered questions -


i asked questions while sending emails programmatically custom module ( link ), , although got working, don't think have working way should be.

first overrode getmail() method in mage_core_model_email_template outlined in this post, raises few questions:

  1. in overriding getmail() method, had specify username , password log on smtp server. can please tell me why not specifiable in magento admin panel? isn't, i'll have gather information in custom module's config have user name , password use when sending e-mail, , seems plain wrong me.

  2. how should load template (the name/id of configuration field in custom module). got loadbycode work:

    $emailtemplate = mage::getmodel('core/email_template')->loadbycode('bob');

but see people doing:

$emailtemplate  = mage::getmodel('core/email_template')->loaddefault('no matter goes here emailtemplate not set'); 

last question. there method can call email templates can offer selection of them in custom module configuration?

thanks.


Comments