In config.xml we set values for “customer_testemail_email_template”, but in code we use Mage::getStoreConfig(“customer/testemail_email/template”) to set $templateId. So we need to create a relation in between two. To do so we will create a installer to insert a data in db config.

In magento If I have created a transaction email template “new_order_for_sales_admin” using “New Order Template”. Then can I use it like below:
$templateId = Mage::getStoreConfig(‘new_order_for_sales_admin’);

Or if the above methode is not possible then I’ll follow your solution, but in your solution one thing which I am not getting is:

You’ve written “To do so we will create a installer to insert a data in db config.” where to make these installer modifications and why??

Are you using this method instead of the default email sender of Magento. If so I will test this on our own site because we can’t get the ‘Contact Us’ form to send emails. This has been a problem for too long now so lets see if your example will overcome our present issue. I will post back here with my findings.

Send out a specific email based on a category or range of sku’s purchased. So in essence I would have different templates. Say “order_new_webinar”, “order_new_ebook”. What would be the best way to go about this?

I would also code templates with variables that would pertain to specific product fields in db table. Information like “event_date” “event_time” or other items from my product database.

This error is coming since In Mage_Contacts_IndexController Line 69 to 110 some exception is occuring. You can echo the exception by adding echo $e->getMessage() in the catch section to see debug what is going wrong.

/**
* $templateId can be set to numeric or string type value.
* You can use Id of transactional emails (found in
* “System->Trasactional Emails”). But better practice is
* to create a config for this and use xml path to fetch
* email template info (whatever from file/db).
*/
const EMAIL_TEMPLATE_XML_PATH = ‘customer/testemail/email_template';
$templateId = Mage::getStoreConfig(EMAIL_TEMPLATE_XML_PATH);

hello Asad,
I am also not getting the code so please help me. Where to write the above file with what name and in which section(local/core)?? from which to extend it ?? also if it is a model then all code except first line ie. const declaration should be in a function(according to my understanding) and where to write installer script?? in sql/module_setup/???
please help….
lots of confusions and urgent..
plz reply asap

I’m developing a new Payment module and I need to generate a Mail out of a frontend form located under app/design/default/>>my layout<>my module name<>my module name<</etc/config.xml and backend in system.xml.

I also tried to solve over controller/IndexControlleer.php within my module. Does not succeed. Is there a known issue with generating Mails out of Payment modules? Security?

Hello! Very good post!
I have another task. In my store each goods it is company, and when i add new goods in my store I add new attribute “company_email”. When customer click button “add in order” I want that magento sent email on Email adress in attribute “company_email”. Also very important that each goods have different value attribute “company_email”.
But i dont understand how i can make it using you solve

Hy it thery good post. A,m new user in magenta. And encounter find that loked for. Thenks for it. And sory for my English. My native russia. I emprove my language.
I have some question. I have 4 contrary email_template and i have 4 template to it. How i can may write use ,magento model. And need that rooter puth was siple not how this http://magento.loc/service/index/index/id_template/template

Can you tell me where can i change the email address for the default template. At the moment, when customer registers, it sends confirmation email to the email entered by user. I want to change that confirmation email to be sent to some other email address other than customers email address. Do you know where can i make that modification.

I have a question. The last part says that if you want to manage this template in the backend you have to add that system.xml . I’ve added it but it doesn’t seem to add anything in the backend. Where should I watch? (I’m on Magento 1.6, maybe that’s related)

1 Trackback or Pingback for this entry:

[…] myself back in the Magento source and forums to try and figure it out. I was just about to go down Asad Rahman’s approach or Branko Ajzele’s but digging around in Magento’s source led me to believe there was […]