<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang 
    $Date: 2014-9-25 下午12:42:53  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
            	begin
                     fnd_atm_attachment_pkg.insert_fnd_atm_mail(
            			p_record_id        =>${@record_id},
                        p_table_name       =>'ZJ_SYS_MAILING_LIST',
                        p_table_pk_value   =>${@mail_list_id},
                        p_file_name        =>substr(${@file_path},instr(${@file_path},'/',-1,1) + 1),
                        p_file_path        =>${@file_path},
                        p_mail_to          =>${@mail_to},
                        p_mail_cc          =>${@mail_cc},
                        p_subject          =>${@mail_subject},
                        p_body             =>${@mail_body},
                        p_mail_source      =>${@mail_source},
                        p_mail_source_id   =>${@mail_source_id},
                        p_content_type     =>nvl(${@content_type},'text/html'),
                        p_user_id          =>nvl(${/session/@user_id},-1));
                        
            	end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
