No Emails Processed, Must run for Dev Account Only
Sending #lsnumberformat( qmd_emailsToSend.recordCount )# emails...
update tbl_WRK_Emails set emailTryCount = coalesce( emailTryCount, 0 ) + 1, emailTryDate = getDate() , emailTryStatus = where ownerId = and ownerType = and emailId =
select e.ownerId, e.ownerType, e.emailId from tbl_WRK_Emails e with (nolock) where e.emailSent = 'D' and ( emailTryDate is null or datediff( hour, emailTryDate, getdate() ) > 3 ) and coalesce( e.emailTryCount, 0 ) < 3 and datediff( day, e.emailDate, getDate() ) <= 2 order by e.emailId