0

I have a data extension in which I have 2 columns:

  • Email
  • CategoryType

The CategoryType column gets data like this:

Category A, Category B, Category C

So for email test@test.com, I can get this - Category A, Category B, Category C

For another email, I can get this - Category D, Category E, Category A

As you can see, I can get different categories for different customers and the data is inserted in my data extension on daily basis.

Hence, category type can easily multiply.

I have to send emails based on audience for each category. So Email 1 to CategoryType A, Email 2 to CategoryType B and so on...

This requires me to create manual data filter for each category and there should be hundreds of different category types. I also won't know if any daily import includes new category type or not.

Is there any way to automate the process of filter creation based on all categories available in the data? OR is there any way to send emails based on specific category only without creating filters?

  • Do you have a fixed set of categoryType values? – Brad Sapkota Sep 7 '17 at 22:32
  • Yes but the total number of categories types is in hundreds. So even creating data filters before hand is a lot of manual work. I just need suggestion on how to automate the process or if there is any other way to send emails to audience based on category types? I can't use main data extension with all data as audience because it will include emails with all categories. – kuml Sep 8 '17 at 11:31
  • just checking if anyone can help with this? – kuml Sep 11 '17 at 19:02
0

You could use a) SQL to automate your split b) Use ampscript in the email, if the email is tied to a certain category, you just split the comma separated values into a rowset, check if the email category is in the rowset; if it's not abort the send using RaiseError function.

For solution b) put this ampscript in your email:

%%[
Var @mailCategory,@customerCategories,@categoryPresent,@customerCategories,@category
Set @emailCategory = "Category A"
Set @customerCategories = BuildRowsetFromString([CategoryType],',')

Set @categoryPresent = false
for @i = 1 to Rowcount(@customerCategories) do
    Set @row = Row(@customerCategories, @i)
    Set @category = Trim(Field(@row,1))

    if @category == @emailCategory Then
        Set @categoryPresent = true
    Endif
next @i

If Not @categoryPresent Then
    RaiseError('Skip customer, email category not in customers categories', true)
Endif
]%%
  • I am not sure if I understand this. Could you please provide me an example or test steps how to do this? – kuml Sep 14 '17 at 19:45
  • Hi @Javier De Mauri - can you plz help? – kuml Sep 18 '17 at 11:45
  • @kuml did you find that useful? – Javier De Mauri Sep 29 '17 at 21:34

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.