select case when email_bouncing_p = 't' then 1 else 0 end
as send_p
from cc_users
where lower(email) = lower(:email)
select case when email_bouncing_p = 't' then 1 else 0 end
as send_p
from cc_users
where user_id = :user_id
update acs_mail_lite_mail_log
set last_mail_date = sysdate
where user_id = :user_id
insert into acs_mail_lite_mail_log (user_id, last_mail_date)
values (:user_id, sysdate)
update acs_mail_lite_bounce
set bounce_count = bounce_count + 1
where user_id = :user_id
insert into acs_mail_lite_bounce (user_id, bounce_count)
values (:user_id, 1)
delete from acs_mail_lite_bounce
where user_id in (select user_id
from acs_mail_lite_mail_log
where last_mail_date < sysdate - :max_days_to_bounce)
update users
set email_bouncing_p = 't'
where user_id in (select user_id
from acs_mail_lite_bounce
where bounce_count >= :max_bounce_count)
delete from acs_mail_lite_bounce
where bounce_count >= :max_bounce_count
select user_id, first_names || ' ' || last_name as user_name
from cc_users
where email = :email
delete
from acs_mail_lite_queue
where message_id = :message_id