title: Sending template emails in Magento
body: <p>I'm creating a Magento Module that can be used to send emails in certain occasions of my website. I'm following the tutorial from Branko Ajzele and everything seems to work fine until I try to send the email where I get a false response from the Send function. </p>
  
  <p>Below is the code I'm using along with the result returned:  </p>
  
  <pre><code>public function sendAction() {
  
      /*
       * Loads the html file named 'custom_email_template1.html' from
       * app/locale/en_US/template/email/activecodeline_custom_email1.html
       */
      $emailTemplate  = Mage::getModel('core/email_template')
                              -&gt;loadDefault('custom_email_template1');                                
  //        var_dump(Mage::getModel('core/email_template'));
      //Create an array of variables to assign to template
      $emailTemplateVariables = array();
      $emailTemplateVariables['myvar1'] = 'Branko';
      $emailTemplateVariables['myvar2'] = 'Ajzele';
      $emailTemplateVariables['myvar3'] = 'ActiveCodeline';
  
      /**
       * The best part &lt;img src="http://inchoo.net/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"&gt;
       * Opens the activecodeline_custom_email1.html, throws in the variable array
       * and returns the 'parsed' content that you can use as body of email
       */
  
      /*
       * Or you can send the email directly,
       * note getProcessedTemplate is called inside send()
       */
      $emailTemplate-&gt;setSenderName('my name');
      $emailTemplate-&gt;setSenderEmail('example@domain.com');
      $emailTemplate-&gt;setTemplateSubject('STATUS CHANGED');
  
      var_dump($emailTemplate-&gt;send('example@domain.com'));
      echo "&lt;br&gt;";
      var_dump($emailTemplate);
  
      exit("test");
  
  }
  </code></pre>
  
  <p>The var_dump given by var_dump($emailTemplate); returns the object with all the information correctly as shown below: </p>
  
  <pre><code>bool(false)
  object(Gp_Notify_Model_Email_Template)#82 (19) { ["_templateFilter:protected"]=&gt; NULL ["_preprocessFlag:protected"]=&gt; bool(false) ["_mail:protected"]=&gt; NULL ["_designConfig:protected"]=&gt; NULL ["_emulatedDesignConfig:protected"]=&gt; bool(false) ["_initialEnvironmentInfo:protected"]=&gt; NULL ["_eventPrefix:protected"]=&gt; string(13) "core_abstract" ["_eventObject:protected"]=&gt; string(6) "object" ["_resourceName:protected"]=&gt; string(19) "core/email_template" ["_resource:protected"]=&gt; NULL ["_resourceCollectionName:protected"]=&gt; string(30) "core/email_template_collection" ["_cacheTag:protected"]=&gt; bool(false) ["_dataSaveAllowed:protected"]=&gt; bool(true) ["_isObjectNew:protected"]=&gt; NULL ["_data:protected"]=&gt; array(6) { ["template_type"]=&gt; int(2) ["template_subject"]=&gt; string(14) "STATUS CHANGED" ["template_text"]=&gt; string(208) "
  ActiveCodeline custom email example by Branko Ajzele
  
  Hi there {{var myvar1}} {{var myvar2}} from {{var myvar3}}. This is just some example template to test custom email module.
  " ["template_id"]=&gt; string(22) "custom_email_template1" ["sender_name"]=&gt; string(7) "my name" ["sender_email"]=&gt; string(15) "phil@gproxy.com" } ["_hasDataChanges:protected"]=&gt; bool(true) ["_origData:protected"]=&gt; NULL ["_idFieldName:protected"]=&gt; NULL ["_isDeleted:protected"]=&gt; bool(false) } test
  </code></pre>
  
  <p>The thing is that although everything seems to go well the send function returns false and of course I never get to receive the email. 
  Is there something I'm forgetting to do like any configuration in the backend or something? </p>
  
  <p>---- UPDATE ----</p>
  
  <p>After some investigation I realized that there are no emails reaching their destination at all in my Magento installation which I thought they were, so figured I should start from there. </p>
  
  <p>I have already added all the emails in the backend.
  I checked the Locale (language) and changed it to english/US (which I read could be an issue). 
  Any advise? </p>