I am trying to send trigger email using triggersend definition.


Sendable DE "Customeractivity" and triggersend DE "TriggerDE"

10 types of activity will be there.

i am pushing records to "customeractivity" table using API, when records coming to a "customeractivity" table i want to send email on type of activity. there is a field called "typecode" in "customeractivity" table.

How can i achieve this.

what about exclusion script?

can i use SQL query in exclusion script?

do i need to exclude it in API only?

do i need to create 10 trigger definitions for all 10 types to exclude?



I assume that you're using a custom application as a source system and not Salesforce Sales or Service Cloud. If so, you can achieve this in the following ways:

  1. Use Ampscript in Exclusion Script. Something like typecode <> "value"
  2. Filter it out on the source system side, don't send it to the Data Extension.
  3. Directly trigger the send from the source system using the REST API - https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/messageDefinitionSends.htm. Just like #2, you need to filter out the criteria on the source sysem.

P.S. - You don't need multiple Trigggered Send Definitions to exclude multiple items. It can be done in a single TS using Ampscript in Exclusion scripts.

  • yes we are using own CRM, from which team is pushing the data to customeractivity table in the exacttarget using API. i have questions 1. can you put exclusion script here? – Ranjith Haridas Oct 12 '17 at 18:26
  • 2. i have to send records to "customeractivity " table which is our main DE in ET, no other way. while inserting records to "customeractivity " table i have to identify the "typecode" field (may be exclusion script) i have to send 10 different type of emails, which requires 10 different TS definition. AM I RIGHT @Rajdeep – Ranjith Haridas Oct 12 '17 at 18:34
  • A Send Definition can use only 1 email template. If your email content needs to vary based on the typecode field (or any other field), then you should look at Dynamic Content Blocks. But if you end up having 10 email templates, then yes, you need 10 different TS definitions – Rajdeep Singh Oct 12 '17 at 18:48
  • fine thanks, what about exclusion script do you have any idea how to write?? – Ranjith Haridas Oct 12 '17 at 18:52
  • sure. exclusion script is written in ampscript and it should be an expression that evaluates to true or false. It's basically works like a where clause in SQL, all records that match the criteria are excluded from the send. Example - ROWCOUNT(LOOKUPROWS("DataExtension", "Column", value)) > 0 – Rajdeep Singh Oct 12 '17 at 19: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.