Complex recurring email situation

Hi,

Imagine I manage a website selling books. Each book belongs to one of 10 categories (horror, fantasy, history, travel,...). Members of the site pick which categories they're interested in through the external CM form. These categories are setup as segments.

Now when person A selects 'fantasy', 'history' and 'travel' and I send a monthly newsletter with new books to each segment I don't want to send three separate emails. I'm looking for a way to combine these segments, and to automatize the process. I could do it manually but with 10 categories there are a lot of combinations which makes it hard to manually set this up.

I could run through each member (around 10k) with a script and generate a unique newsletter but that seems quite complicated (processor intensive).

I'm comfortable using the API and looking for a general approach.

bc173, 2 years ago

Ok, I think I've found a solution for my case using the recently announced 'Dynamic Content' feature:

http://www.campaignmonitor.com/blog/pos … ic-content

What I'm planning to do is - using PHP through the API - generate a campaign each week using dynamic content tags. So the body of the mail would look like:

[if:CustomField=fantasy]
- Book 1
- Book 2
- Book 3
[endif]

[if:CustomField=history]
- Book 4
- Book 5
- Book 6
[endif]

[if:CustomField=travel]
- Book 7
- Book 8
- Book 9
[endif]

[if:CustomField=horror]
- Book 10
- Book 11
- Book 12
[endif]

[if:CustomField=drama]
- Book 13
- Book 14
- Book 15
[endif]

[if:CustomField=politics]
- Book 16
- Book 17
- Book 18
[endif]

The disadvantages of this technique:

1. Reports will not be part of the 'Recurrent Reports', so it'll be a bit harder to see trends like opens and click increases/decreases over time.

2. It'll generate a lot of reports under "Recently Sent Campaign Reports" and it'll be hard to find other campaigns among these auto-generated weekly reports.

The pro's are:

1. Without the above technique the only way was to send a separate campaign for each book category which would result in one person receiving multiple mails (one for each category) which would come across really spammy.

2. Because I'll generate the campaigns with PHP, it doesn't need to rely on RSS. RSS is limiting because there are only a few fields to fall back on.

An even better solution would be:

1. Allowing dynamically recurring RSS campaigns; depending on a custom field one can pull in a different RSS feed.

roshodgekiss roshodgekiss, 2 years ago

Hi bc173, it looks like you've thought this one through - good work there. This is the sort of scenario that really lends itself to dynamic content, so we'd be keen to hear how you go with this :)


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor
bc173, 2 years ago

Unfortunately I could not use the described technique. The problem is, if a subscriber only subscribed to one category and there is no content for that category then this person would receive an empty newsletter.

The only 'clean' option left is hacking around custom fields. I've reserved 15 custom fields that I'll fill through the API. If custom fields would allow for more than 250 characters it would be a little easier. The 250 character limit is problematic when dealing with an item for which the title + url + HTML markup exceeds 250 chars :/

JohnP JohnP, 2 years ago

A couple of ways around that:

- if only 1 category, show a generic 'best of the rest' or 'top sellers' list
- if no 'new' items in the category, add some 'recent' items instead

Ultimately the data is coming from you, so there is not many limitations on CM's end that you can't work around programmatically with the API on your end.

bc173, 2 years ago

Hi John, thanks for your input. I've been thinking about this as well, but it can't be achieved. The problem is, the IF blocks (see above) don't know of each other. So multiple IF blocks could be empty. Adding multiple times recent items may result in duplicate items.

supernath, 2 years ago

Couldn't you add an extra logic chain at the end to determine if any of the other blocks worked and pull in a general version?

For example,
if customfield = drama, show drama
if customfield = history, show drama
if customfield = fiction, show fiction

if customfield = drama (do nothing)
elseif customfield = history (do nothing)
elseif customfield = fiction (do nothing)
else show generic content

So the generic content would only be triggered if and only if all the previous entries were empty.

JohnP JohnP, 2 years ago

You are right that the dynamic tags don't know of each other. CM would have to add [if ... || ... ] or [if ... && ... ] functionality to their dynamic content for that to happen.

I assumed as you are using the API that you can code a solution yourself before importing the content back to CM. To avoid sections with empty lists, you'd just need to put the whole content block inside the dynamically displayed section, and only show if the book count is >0. Even better would be to change your list to 'no new items this week' to avoid any reader confusion.

For my previous suggestions:
1. You could use the API to pull each subscribers genre selections, if any are empty this week, write some backup content to a hidden custom field and display that. Not the easiest way to do it, but that's probably your only option until CM adds more comparison operators.

2. Pretty straight forward - simply add older books to your list and display as normal.

IMHO, having a 'best of the rest' list as a permanent fixture at the bottom of the email is probably a good thing - it is non obtrusive and might spark some interest. Everyone needs to give Christmas gifts if you know what I mean.

JohnP JohnP, 2 years ago

supernath has a good point. Not sure if it will work, but stacking the [if ... ] dynamic fields inside of each other (in the content of the first dynamic field, and so on) is the same as an [if ... && ... ] type comparison.

Are nested dynamic fields possible? Anyone?

bc173, 2 years ago

I don't see how supernath's suggestion can be working. The dynamic tags can check whether a custom field exists (whether a user is subscribed to a certain book category), but not whether there is content within the dynamic block...

JohnP, your suggestion #1 is what I'm currently exploring. I've created 15 custom fields named data1, data2,... each can contain max one book + link + HTML. This way I can show users 15 books. It requires quite some coding to achieve this though...

Suggestion #2 is not applicable for me. I used books as an abstracted example, but in reality I'm not dealing with books. The benefit with books is that they don't expire, that there are tons of them and that old books are still relevant. This doesn't apply to products that have a limited run and expire.

I haven't tested nested dynamic tags. I believe I've read this is possible. But I don't see how can use this to achieve my goal.

JohnP JohnP, 2 years ago

If you know that this week 'fantasy' and 'history' (lets stick to the books for now) are going to be empty categories - they are the only ones that need the alternate content. So something like this workflow might work:

[if not travel]
    [if not horror]
        [if not drama]
            Alternate content here...

supernath, 2 years ago

Hi all,

The docs show you can do:

[if:CustomField=x][elseif:CustomField=y][else][endif]

What I'm proposing is you use distinct if statements to pull in the different book sections based on the custom settings first. Afterwards, have one mostly empty if/elseif/else statement to make sure no empty emails are sent.

For example:

[if:CustomField=fantasy]
- Book 1
- Book 2
- Book 3
[endif]

[if:CustomField=history]
- Book 4
- Book 5
- Book 6
[endif]

[if:CustomField=fantasy]
[elseif:CustomField=history]
[else]
- Generic books
[endif]

So if customfield = fantasy is valid, it will show those books. If customfield = history is valid, it will show those books as well. If neither of them are valid the generic books are pulled in.

It's just an thought, no idea if it would actually work. :)

roshodgekiss roshodgekiss, 2 years ago

Hi there folks, first of all, it is possible to nest dynamic content tags. So to create an AND scenario, you could use something like:

<p>[if:Interests=fantasy][if:Status=PreviousCustomer]Liked your earlier purchase? We can also recommend...[endif][endif]</p>

For the IF/ELSEIF/ELSE scenario, the most efficient way to do this is:

<p>[if:Interests=fantasy]...fantasy books...
[elseif:Interests=history]...history books...
[elseif:Interests=reference]...reference books...
[else]...generic books...
[endif]</p>

I hope this helps - it also pays to experiment too, especially as you can preview the result from within the app :)


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor
bc173, 2 years ago

@supernath I appreciate you're trying to solve the puzzle, but I still don't think it's possible.

The following code:

[if:CustomField=fantasy]

Reads as follows:

"If the customer has indicated he wants to see books around 'fantasy' then..."

and not:

"If there are books available in the 'fantasy' category then..."

You're thinking of the latter, but that's not what the code does.

bc173, 2 years ago

@supernath You made me think, and I think there is a solution! Given that I'll generate the campaign through the API, I will know which categories are empty and can avoid putting these dynamic content tags in the newsletter altogether. Then I can use your nested ending block because it's guaranteed that all categories referenced are holding content. If the subscriber didn't subscribe to any of these categories he'll get to see default content (with a message that personalized items couldn't be found).

Happy I found a good solution for this! Thanks for exploring the options with me!

JohnP JohnP, 2 years ago

Pretty sure that is what I suggested halfway up the thread...

JohnP :

If you know that this week 'fantasy' and 'history' (lets stick to the books for now) are going to be empty categories - they are the only ones that need the alternate content. So something like this workflow might work:

[if not travel]
    [if not horror]
        [if not drama]
            Alternate content here...

Anyway, glad you got there in the end!

Join 150,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098