Different email template for “Order Placed” trigger.

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Pawan
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Mon May 04, 2009 5:56 am

Different email template for “Order Placed” trigger.

Post by Pawan » Mon May 04, 2009 7:19 am

I am using Able7.0.
I set up two vendors.
How do I send a different email content to the customer and vendor based on vendor and products? I want email to be triggered on “Order Placed”.
I found it is possible with single template. viewtopic.php?f=42&t=10338&p=44891&hili ... cts#p44891

Can I do with different templates?
Please help me.


Pawan
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Mon May 04, 2009 5:56 am

Re: Different email template for “Order Placed” trigger.

Post by Pawan » Tue May 05, 2009 4:24 am

Thanks,
In mentioned thread event is related to admin, but i wanted to trigger the Email to send when users place the order. Could you please tell me for which aspx Page/Control and in which event I have to write that code that you referenced in following thread viewtopic.php?f=42&t=8571

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Different email template for “Order Placed” trigger.

Post by mazhar » Tue May 05, 2009 4:31 am

In order to send Emails when user places an order you can place the code in CheckedOut handler method in ConLib/OnePageCheckout.ascx.cs control file.

Pawan
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Mon May 04, 2009 5:56 am

Re: Different email template for “Order Placed” trigger.

Post by Pawan » Wed May 06, 2009 5:18 am

I am using attached Email Template for “Order Place”. In this template Order, Payment, store and some other objects are used. Could you please guide me to how do I get these objects in OnPageCheckout.ascx.cs [Event CheckedOut] and pass to the template?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Different email template for “Order Placed” trigger.

Post by mazhar » Wed May 06, 2009 10:47 am

Code: Select all

Order order = OrderDataSource.Load(e.OrderId, false);
        if (order != null)
        {
            foreach (OrderItem orderItem in _Order.Items)
            {
                
                EmailTemplateCollection emailTemplates = EmailTemplateDataSource.LoadForCriteria(" Name = 'Order Placed' ");
                if (emailTemplates.Count > 0)
                {
                    emailTemplates[0].Parameters.Add("store", Token.Instance.Store);
                    emailTemplates[0].Parameters.Add("order", _Order);
                    emailTemplates[0].ToAddress = orderItem.Product.Vendor.Email;
                    emailTemplates[0].Send();
                }
                
            }
        }

Pawan
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Mon May 04, 2009 5:56 am

Re: Different email template for “Order Placed” trigger.

Post by Pawan » Thu May 07, 2009 5:43 am

Thanks for support.
I done it. It's very helpful for me.

Post Reply