how to retrieve the to_addrs and cc_addrs from the SugarCRM database for pmse process email template:

Hi All,

Read my query below and suggest how to retrieve the to_addrs and cc_addrs from the SugarCRM database:

SELECT
    proj.prj_module,
    proj.id as Process_Definition_ID,
    proj.name as Process_Definition_Name,
    def.evn_criteria as Process_Email_Template_ID,
    templ.name as Process_Email_Template_Name,
    proj.prj_status as Process_Definition_Status,
    emm.to_addrs,
    emm.cc_addrs
FROM
    pmse_bpm_event_definition def
LEFT JOIN
    pmse_emails_templates templ
ON
    def.evn_criteria = templ.id
LEFT JOIN
    pmse_bpm_process_definition prodef
ON
    def.pro_id = prodef.id
LEFT JOIN
    pmse_project proj
ON
    prodef.prj_id = proj.id
LEFT JOIN
    pmse_email_message emm
ON
    emm.YOUR_COLUMN_NAME = YOUR_CONDITIONS
WHERE
    templ.name IS NOT NULL
    AND proj.prj_status = 'ACTIVE';

Kindest Regards,

Shreya