Hitting SMTP rate limits at certain domains? Put leads into fixed-size daily buckets (using FlowBoost)

A client has a pesky problem with a partner: end users are eager to get Marketo emails, but their mailserver has strict inbound rate limits.

With several thousand Marketo records @ that domain (and growing!) they regularly see Soft Bounce once they exceed the daily rate limit of 1500 emails per day. It’s not tied to particular email addresses, just whoever’s unlucky enough to be person 1501+ for the day.

So we need a way to drop people into 1500-person buckets, starting with Bucket 1. Then we can space out the sends so Bucket 1 goes out on Monday, Bucket 2 on Tuesday, and so on.

And there should be the option to have different size buckets depending on the domain, in case we find another domain with a daily limit of, say, 500 or 3000.

You can’t do this with Marketo alone, but FlowBoost makes it easy. First create an Integer field Staggered Sending Bucket:

The FlowBoost payload is simple:

const knownDomainBucketSizes = new Map;
knownDomainBucketSizes.set("example.com", 1500); // known limit for @example.com
knownDomainBucketSizes.set("anotherexample.com", 500); // another known domain

const defaultBucketSize = 100; // if you call the ‘hook for any other domain

const emailDomain = FBUtil.string.partsFromEmail({{lead.Email Address}}).domain;
const domainBucketSize = knownDomainBucketSizes.get(emailDomain) || defaultBucketSize;

FBCounter.autoAdd(`/domainBuckets/${emailDomain}`)
.then( newEntry => {
  const bucket = Math.ceil( (newEntry.entryIndex + 1) / domainBucketSize );
  return success(bucket);
});

Make sure to add the query param authoringEnv=pro to the end of the FlowBoost URL, as you always do when using FBCounter:

And map the standard response property to the new field:

Then filter your sends by bucket:

A little deeper into the “algorithm” above

It barely rises to the level of computer science, but the code above works like so:

  • add a record to the counter
  • get that new record’s index, which gives the current total count
  • add 1 to the count so it’s more user-friendly (you probably want Bucket 1, Bucket 2, ... instead of Bucket 0, Bucket 1, ...)
  • divide the current count by the bucket size, e.g. if the count is 110 and the bucket size is 100, that’s 110/100 = 1.1
  • get the integral ceiling of the result, e.g. Math.ceil(1.1) is integer 2
  • the ceiling is the bucket they’re in!

And no, Random Sample can’t do this

Marketo’s Random Sample flow step can only do percentages, not fixed sizes. As the audience is ever-growing, it’s impossible to use it for this case. Random Sample is for when you have a fixed-size list/one-time send and can pre-compute a % that approximates the bucket size.