kintana_scripts_email_notifications_to_explicit_usernames_userids_addresses
The KNTA_NOTIFICATIONS table condition_value field maps to
the KWFL_WORKFLOW_STEPS workflow_step_id field for requests and packages.
select ww.workflow_name,
wws.sort_order "Step#",
wws.step_name,
nnr.email_address
nnr.recipient_type_code,
-- nnr.notification_recipient_id,
nnr.user_id,
nu.username,
nu.first_name || ' ' || nu.last_name "Full Name"
from KWFL_WORKFLOWS ww,
KWFL_WORKFLOW_STEPS wws,
KNTA_NOTIFICATIONS nn,
KNTA_NOTIFICATION_RECIPIENTS nnr,
KNTA_USERS nu
where wws.workflow_id = ww.workflow_id
and wws.workflow_step_id = nn.condition_value
and nn.notification_id = nnr.notification_id
and ( ( nnr.recipient_type_code = 'USER'
and nnr.user_id is not NULL
and nu.user_id = nnr.user_id)
or
( nnr.recipient_type_code = 'USER_ID'
and nnr.token is NULL
and nnr.user_id is not NULL
and nu.user_id = nnr.user_id)
or
( nnr.recipient_type_code = 'EMAIL_ADDRESS'
and nnr.email_address is not NULL
and nu.email_address = nnr.email_address)
)
-- Limit to Enabled Workflows
and ww.enabled_flag = 'Y'
-- Limit to one workflow
-- and ww.workflow_name = 'My Workflow'
-- Limit to one user
-- and nu.last_name = 'Houdini'
order by ww.workflow_name, wws.sort_order
|