This issue has the potential to save other developers quite a bit of time and frustration when buying IP addresses because it will help them warm up the IPs appropriately. Warming up is a process of slowly ramping up sending on an IP address to allow Email Recipient servers (e.g. gmail, hotmail, etc) to see that this IP is legit.
Sending emails from a pool
This calculation will look at all of the items that control the number of emails sent through each IP and set the number of emails to send through this pool. This will allow the pools to be rotated, as well as the IPs.
totalEmailsToSend = 50 * numIpsInThisPool
if warmupDay > 1
growthRate = (currentDailyVolume / (totalEmailsToSend))^(1/totalDaysToWarmup)
totalSend = (50 * growthRate) ^ (warmupDay - 1)
Calendar Day 1 / WarmupDay 0 - 20170101
Calendar Day 2 / WarmupDay 1 - 20170102
Calendar Day 3 / WarmupDay 2 - 20170103
Calendar Days 4-15 / warmupDays 3-14
Calendar Day 16 / warmupDay 15 - 20170116
Calendar Day 1 / warmupDay 0 - 20170205
Calendar Day 2 / warmupDay 1 - 20170206
Calendar Day 3 / warmupDay N/A - 20170207
Calendary Day 4 / warmupDay 1 - 20170208
Calendar Day 5 / warmupDay 2 - 20170209
Day 15
@mbernier ,
I was under the impression that SendGrid could take care of automatically warming up IP addresses based on the information I read here, here and here:
SendGrid can automatically warmup dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. This section allows you to use the API to create IP pools, assign IP addresses to them, and enable IP warmup pools and the IPs within pools.
Am I wrong about this?
The warmup that is available over the API provides no control to the user. The IPs go into warmup and they come out of warmup when they're done. This process also assumes a constant rate of sending each day.
This process would allow the user to customize the rate at which they warm up and it accounts for the fact that some users send in an inconsistent way (monday, wed, fri or "on the 15th"). Our compliance team has seen some issues for customers who send inconsistently and helped me write up this spec.
This process will allow users who send in/consistently or who want to raise/lower their daily rate at will.
@mbernier what are your thoughts on keeping track of the number of emails sent throughout a given day before totalEmailsToSend is reached?
What you have proposed so far I think will work fine for scenarios where the number of emails in a single Mail.Send exceeds the number of warmup emails for a given day. But what if a customer sends only a few emails at a time? Let's use examples to illustrate what I'm talking about.
First example, a rather simple scenario:
In this scenario, our logic will automatically send 100 emails using the IP address being warmed up and the remaining 50 emails will be sent using the default IP.
Second example:
In this scenario, we want our logic to use the IP address being warmed up until the 100th password reminder is sent and to use the default IP for password reminders sent subsequently.
Since you want to avoid using a repository (such as a database for example) to track where we are in the process, how do you propose we keep track of the number of emails sent in a given day?
Would using the name of the pool to track the number of emails sent in a given day be reasonable? This would match your proposal to use the IP pool name to track the date when the warmup pool was last used but it would potentially involve a lot of updates in a given day.
@mbernier An email with 4 TOs, 3 CCs and 2 BCCs counts as 9 emails right as far as counting the number of emails sent on an IP being warmed up is concerned, right?
@Jericho yep, any email address that receives an email actually gets a single email request to the ISP.
In your example, the SMTP server would actually create 9 different requests, setting the primary recipient on each one and then sending it.
Great point, I didn't think about this when writing the spec...
@mbernier I'm about to publish a new version of the StrongGrid library with a WarmupEngine which meets all your goals but I have departed a little bit from your design by not using the pool name to store data such as the warmupDay and the number of emails sent. I'm finishing up updating the readme and will publish shortly.
StrongGrid version 0.34.0 was just released to nuget. The version includes a new WarmupEngine which achieves the following goals:
More documentation available in the readme
@Jericho ... this is amazing! I am sharing with our deliverability team right now, they are going to be super excited.