Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento: Email template crashes new template form
    primarykey
    data
    text
    <p>I have a module that I'm trying to use with an email template I created. I created the .phtml template directly (not through the new template form on the backend) into the locale > en_US > template > email folder. The template seems to work as the variables passed to it work and the email gets sent fine. My only problem is that now when I go into the management > Transactional Emails > New Template, the page crashes. The dropdown is empty and everything after it does't get rendered.</p> <p>I think it might have something to do with the way I'm loading the template in the modules config.xml. When I remove the reference to the template the problem goes away. Put the reference back in and the form crashes..</p> <p>Config.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;Optimise_Requestcallback&gt; &lt;version&gt;0.1.9&lt;/version&gt; &lt;/Optimise_Requestcallback&gt; &lt;/modules&gt; &lt;frontend&gt; &lt;routers&gt; &lt;requestcallback&gt; &lt;use&gt;standard&lt;/use&gt; &lt;args&gt; &lt;module&gt;Optimise_Requestcallback&lt;/module&gt; &lt;frontName&gt;request-callback&lt;/frontName&gt; &lt;/args&gt; &lt;/requestcallback&gt; &lt;/routers&gt; &lt;layout&gt; &lt;updates&gt; &lt;requestcallback&gt; &lt;file&gt;optimise.xml&lt;/file&gt; &lt;/requestcallback&gt; &lt;/updates&gt; &lt;/layout&gt; &lt;/frontend&gt; &lt;global&gt; &lt;template&gt; &lt;email&gt; &lt;requestcallback_template translate="label" module="requestcallback"&gt; &lt;label&gt;Optimise RequestCallback&lt;/label&gt; &lt;file&gt;requestcallback_template.html&lt;/file&gt; &lt;type&gt;html&lt;/type&gt; &lt;/requestcallback_template&gt; &lt;/email&gt; &lt;/template&gt; &lt;/global&gt; &lt;/config&gt; </code></pre> <p>Here is how I send the email:</p> <pre><code>public function sendemailAction() { $emailTemplate = Mage::getModel('core/email_template') -&gt;loadDefault('requestcallback_template'); $emailTemplateVariables = array(); //Fetch submited params $params = $this-&gt;getRequest()-&gt;getParams(); $subjectOfMail = "Request a Callback from the Puji Website&lt;br /&gt;&lt;br /&gt;Product = " . $params['product'] . "&lt;br /&gt;Name = " . $params['name'] . "&lt;br /&gt;Email = " . $params['email'] . "&lt;br /&gt;Telephone = " . $params['telephone'] . "&lt;br /&gt;Message = " . $params['comment']; $emailTemplateVariables['body'] = $subjectOfMail; $emailTemplate-&gt;setSenderName($params['name']); $emailTemplate-&gt;setSenderEmail($params['email']); try { $emailTemplate-&gt;send('billy@optimiseweb.co.uk', 'Sales', $emailTemplateVariables); Mage::getSingleton('core/session')-&gt;addSuccess('Thank you! We will contact you very soon.'); } catch (Exception $ex) { $translate-&gt;setTranslateInline(true); Mage::getSingleton('customer/session')-&gt;addError(Mage::helper('contacts')-&gt;__('Unable to submit your request. Please, try again later')); $this-&gt;_redirect('*/*/'); return; } //Redirect back to index action of (this) activecodeline-simplecontact controller $this-&gt;_redirect('request-callback/'); } </code></pre> <p>And the template itself probably couldn't be any simpler!</p> <pre><code>&lt;!--@subject Request a Callback from the Puji Website @--&gt; {{var body}} </code></pre> <p>Can anyone see an issue here that would cause the New template form to crash?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload