mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-05 16:02:48 +00:00
feat: apply the reserved-or-confirmed send filter to the workspace sent-today count, the advisor mailbox volume windows, and the deliverability dashboard denominator so campaign wake-ups stop inflating sent totals
This commit is contained in:
@@ -664,7 +664,8 @@ func (r *advancedOutreachRepository) GetDeliverabilityDashboard(ctx context.Cont
|
||||
SELECT COUNT(*) FROM tasks t
|
||||
JOIN email_accounts ea ON ea.id = t.email_account_id
|
||||
WHERE ea.organization_id = $1 AND t.task_type = 'campaign' AND t.status = 'completed'
|
||||
AND t.completed_at >= $2 AND t.completed_at <= $3`
|
||||
AND t.completed_at >= $2 AND t.completed_at <= $3
|
||||
AND ` + taskDispatchedEmail
|
||||
_ = r.db.QueryRow(ctx, sentQuery, organizationID, from, to).Scan(&out.EmailsSent)
|
||||
out.BounceRate = models.Rate(out.BounceCount, out.EmailsSent)
|
||||
out.ComplaintRate = models.Rate(out.ComplaintCount, out.EmailsSent)
|
||||
|
||||
@@ -70,6 +70,7 @@ func (r *advisorRepository) loadMailboxes(ctx context.Context, orgID uuid.UUID)
|
||||
WHERE t.email_account_id = ea.id
|
||||
AND t.task_type = 'campaign' AND t.status = 'completed'
|
||||
AND t.completed_at > NOW() - INTERVAL '30 days'
|
||||
AND ` + taskDispatchedEmail + `
|
||||
) sent ON true
|
||||
LEFT JOIN LATERAL (
|
||||
SELECT
|
||||
|
||||
@@ -641,6 +641,7 @@ func (r *organizationRepository) GetEmailsSentTodayCount(ctx context.Context, or
|
||||
AND t.task_type = 'campaign'
|
||||
AND t.status = 'completed'
|
||||
AND t.completed_at >= CURRENT_DATE
|
||||
AND `+taskDispatchedEmail+`
|
||||
`, orgID).Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user