1

I have TriggerSend that I call using the web api.

in the Email there is AMPScript

A section of that AMPScript is suppose to clear data from named Data Extensions. However, no rows are ever removed.

here is the code:

if Not Empty(@order_id) then
    DeleteDE("order", "order_id", @order_id)
    DeleteDE("order_product", "order_id", @order_id)
    DeleteDE("order_shipping", "order_id", @order_id)
endif

A few things.

I know for a fact that @order_id has a value, because in the body of the email, I echo out the value

Your Order id is #%%=v(@order_id)=%%

which correctly displays the order value.

However, even though the email is sent, and the order value in the email body is correct, and points to rows in the DE that contain that order id, they are not deleted.

Can someone please help me with this issue?

  • Is order_id a primary key in all of those data extensions? – Mac Mar 27 '14 at 23:20
  • No, since there is a one to many relationship. By that I mean, there could be two rows in lets say order_product, that have the same order_id. And my understanding is, that primary keys need to be unique, is that wrong? – Question Mar 27 '14 at 23:43
  • 2
    Ignore my previous question about primary key, it would work without a primary key. The AMPscript looks correct to me. Could it be an issue where that AMPScript was added to the email after the triggered send was published so it needs to be published again for those changes to work? – Mac Mar 28 '14 at 1:01
  • Are the mismatched quotes a typo here, or in your code? – Kelly J Andrews Mar 28 '14 at 1:42
  • typo -- sorry about that – Question Mar 28 '14 at 2:50
2

@Mac was able to identify the problem.

...Could it be an issue where that AMPScript was added to the email after the triggered send was published so it needs to be published again for those changes to work?

The issue was, that after making chances to my Email located at

Content > My Emails > Store > Receipt

I simply Validated the email, and Saved it. With the misconception that the changes I make here, will automatically update the TriggerSend as well.

However, it turns out, if you have a TriggerSend defined, and you change the email it is pointing it to, you have to go back to that same trigger:

Interaction > Messages > Trigger Sends > [your trigger]

select it, and click Publish Changes

It is now my understanding, that the Trigger does not point to directly to the email that was select when you created it, but rather a copied version of it.

The reason for this, is to allow you to edit the email directly, without the need to pause the TriggerSend. Since any edits you make, would require at least some validation and testing, before you'd want to make them live.

| improve this answer | |
  • 1
    We do this so you can directly edit your email without affecting any current sending happening. Important item to make a note of, glad you got it working! – Kelly J Andrews Mar 28 '14 at 15:58
  • Thanks Kelly. After I went back and was working with it a bit more, it became very clear to me why this was the case. Since it would cause problems, if I am in the process of editing the email, while the trigger is live and sending out emails. – Question Mar 28 '14 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.