Initial Outreach
Queueing

Initial Outreach Queueing Logic

Our system handles the queueing of initial outreach emails in a structured and efficient manner. Let's dive into the details of how this process works.

Cron (Timed) Jobs

We have two cron jobs set up to trigger the queueing of initial outreach emails:

  1. Monday-Friday at 6am ET: This job queues a worker to queue initial outreach emails sometime between 0 and 1 hours in the future.
  2. Saturday/Sunday at 10am ET: This job queues a worker to queue initial outreach emails sometime between 0 and 1 hours in the future, with a volume ratio of 0.5.

These cron jobs ensure that the queueing process is triggered at the appropriate times.

Queueing Process

The main queueing process is handled by the QueueInitial function in the blaster package. Here's a breakdown of the steps involved:

  1. Retrieve the associate based on the provided AssociateID.
  2. Calculate the daily initial send limit based on the associate's DailyLimit settings and the provided VolumeRatio.
  3. Fetch the pending blast contacts for the associate, filtered by script ID and list ID if provided.
  4. Randomize the order of the blast contacts.
  5. Group the blast contacts by OutlookLoginID.
  6. Iterate over the grouped blast contacts in a round-robin fashion: Check if the rate limit is reached for the current OutlookLoginID. If so, skip to the next one. Queue the blast contact for sending using the queueInitial function. Handle any errors that occur during the queueing process.
  7. Send the final queue counts through the provided channel.

Individual Queueing

The queueInitial function handles the queueing of an individual blast contact. It performs the following steps:

  1. Check if the blast contact should be queued based on certain conditions.
  2. Apply rate limiting and calculate the delay for the blast contact.
  3. Enqueue the blast contact for sending with the calculated delay.

That covers the main logic behind how we queue emails for initial outreach. The process is designed to handle rate limiting, distribute the load across different OutlookLoginIDs, and ensure that the emails are sent at the appropriate times.

Rate Limiting and Delay The limitAndDelayInitial function handles the rate limiting and delay calculation for each blast contact. It performs the following steps: If a limit is set (greater than or equal to 0), acquire a semaphore for the associate. If the semaphore is not available, skip the enqueue process for this blast contact. Increment the delay counter for the associate and calculate the delay based on the associate's settings.