Tags/topics: 
1
Answers
Vote up!
0
Vote down!

Order Status, Rules, Emails, oh my

For some reason whenever an order status is changed at all, the order owner gets sent an email.

I'm using a generic Commerce profile, and I've gone from there.

Because I'm using Shibboleth to manage authentication, I don't have "normal" Drupal accounts. Or, if I do, I don't know about them properly, or actually have time to find out, at the moment. Therefore, the rule for setting up an anon. customer profile is firing off all the time. I'm actually ok with that, if I could just turn off the part where the email gets sent, and add in a few custom rules so that emails get sent when I want them to. I'm manually managing $order->mail property, so it's all working, just too many times.

So, I deleted the rules. Actually, I deleted all of the Commerce Checkout rules. Why? Because for some reason they are sticky in the db, and they never went away. I tried disabling the rules first, but it simply didn't work: they stuck.

Questions:
Why are the rules so sticky? It's not showing in the rules list anymore, but it may exist because to get it out of there, what I did was to alter the event that a rule was firing from.

I'd feel better if I could reset the rules to a default state, or import them as a feature, or just know which tables to fiddle with so that I can have a better handle. Is there a way to reset those? Is there a way to export them as a feature from a fresh install? Would this wreak havoc all over the place?

Is there a hook I can get into and circumvent things?

Many, many thanks in advance. This is for a pretty large system for a major University, and we're loving Commerce. It's been really flexible and has allowed us to roll out custom payments, order types, etc, all in just a month or so.

Asked by: jherr
on July 1, 2012

1 Answer

Vote up!
0
Vote down!

I'm not sure if I can answer the stickiness question very adequately. But you definitely need an answer. So here goes:

We have built the commerce system on the idea that there is a lot to be gained from implementing most logic using the Rules system. We've chosen that to increase flexibility to the point where we now find your situation, where you simply want to turn it off. You can disable these rules, but you want them gone?

My understanding is that when rules are "default" implemented in code, you can only disable, not delete them (very similar to features or views).

My thinking about your email que is that you will need a hook that circumvents the email system from sending that email. Please see this answer (also asked/answered by yourself):

http://www.drupalcommerce.org/questions/3418/turn-all-emails

Josh Miller
Answer by: Josh Miller
Posted: Jul 13, 2012