Page 1 of 1

Disable email triggers through API?

Posted: Thu Dec 04, 2008 4:35 pm
by adamh
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

Re: Disable email triggers through API?

Posted: Sat Dec 06, 2008 5:26 am
by mazhar
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();

Re: Disable email triggers through API?

Posted: Mon Dec 08, 2008 10:03 am
by adamh
Thank you for the suggestion. I decided to just remove the triggers on both sites and manually email them in the correct places.