Magento Email Templates

How can I configure different email templates to confirm the order of the email client and its copy of the administrator.

I need to add additional content for a copy of the admin email.

thank

+3
source share
5 answers

I assume that you are currently using the "copy" function to send admin email. Let me know if this is not the case. Since the same email address is currently being sent to multiple recipients, it would be difficult to change the content for each recipient. However, you can send multiple emails with a bit of code, allowing you to use a different email template for each. This can be achieved by creating a new class:

class MyModule_Model_Sales_Order extends Mage_Sales_Model_Order {

    /**
     * Sending email with order data
     *
     * @return Mage_Sales_Model_Order
     */
    public function sendNewOrderEmail() {
        parent::sendNewOrderEmail();

        /**
         * Your admin email sending code here. Copy it out of the sendNewOrderEmail
         * function in Sales_Order.
         */

        return $this;
    }
}

And then tell Magento to override the main class inside your configuration module:

<config>
    <global>
        <models>
            <mymodule>
                <class>MyModule_Model</class>
            </mymodule>
            <sales>
                <rewrite>
                    <order>MyModule_Model_Sales_Order</order>
                </rewrite>
            </sales>
        </models>
    </global>
</config>

You will need to create the template you want and make sure that your overridden model uses this template.

+4
source

, : if namespace Custom, Custom_MyModule_Model Custom_MyModule_Model_Sales_Order, XML :

<config>
    <global>
        <models>
            <mymodule>
                <class>Custom_MyModule_Model</class>
            </mymodule>
            <sales>
                <rewrite>
                    <order>Custom_MyModule_Model_Sales_Order</order>
                </rewrite>
            </sales>
        </models>
    </global>
</config>
+1

HTML > locale > en_US > templates > email

0

, , .

, , , "sales" "catalog" config.xml.

0

: http://codecanyon.net/item/send-new-order-email-to-admin/3198802

It totally costs $ 10, which I spent all the time trying to find another answer that works here. I just finished creating my own module for the contact form, but other solutions here did not work.

0
source

Source: https://habr.com/ru/post/1728031/


All Articles