Disable email triggers through API?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
adamh
Ensign (ENS)
Ensign (ENS)
Posts: 17
Joined: Fri Nov 14, 2008 11:14 am

Disable email triggers through API?

Post by adamh » Thu Dec 04, 2008 4:35 pm

We have a custom site that uses the AbleCommerce API that acts as a portal to re-brand products on our main site. We have customers login and take orders from the custom site, and the orders are fed to the main site as a regular order. Problem is it still uses the main site's email templates for all normal triggers (order notification, password recovery in particular).

As of now, we are manually sending emails through the CommerceBuilder.Messaging api when we do a password recovery or place a new order. However, because the triggers are in place on the main site, we will get 2 emails each time; one from the custom site for the manual email and the other from the main site for the tiggered email. We still like having these for the main site, but would like to send a different template with our custom site.

Is there any way to disable the triggers through the api? As in, disable the 'Customer Password Request' trigger when we call a User.GeneratePasswordRequest() and the 'Order Placed' trigger when we call a Basket.Checkout().

Any advice would be appreciated.

Thanks,
Adam

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

Re: Disable email triggers through API?

Post by mazhar » Sat Dec 06, 2008 5:26 am

Try to manually load the required Email tempalte and then save it after clearing its assigned triggers something like below

Code: Select all

EmailTemplate emailTemplate = EmailTemplateDataSource.Load(emailTemplateId /*Your Email template id*/ );
        emailTemplate.Triggers.Clear();
        emailTemplate.Save();

adamh
Ensign (ENS)
Ensign (ENS)
Posts: 17
Joined: Fri Nov 14, 2008 11:14 am

Re: Disable email triggers through API?

Post by adamh » Mon Dec 08, 2008 10:03 am

Thank you for the suggestion. I decided to just remove the triggers on both sites and manually email them in the correct places.

Post Reply