Recently I upgraded to APEX 18.2 and am trying to use the new email template feature with APEX_MAIL but so far have had nothing but issues.
I am executing this code from SQL Developer using the parsing schema of the workspace in question, I believe I am setting the workspace and session correctly.
Every time I execute the apex_mail.send while using templates I get the following error.
Error report -
ORA-01403: no data found
ORA-06512: at "APEX_180200.WWV_FLOW_MAIL", line 1019
ORA-06512: at "APEX_180200.WWV_FLOW_MAIL", line 819
ORA-06512: at "APEX_180200.WWV_FLOW_MAIL", line 855
ORA-06512: at "APEX_180200.WWV_FLOW_MAIL_API", line 88
ORA-06512: at line 22
01403. 00000 - "no data found"
*Cause: No data was found from the objects.
*Action: There was no data from the objects which may be due to end of fetch.
Below is the code that I am using to execute APEX_MAIL. My goal is to execute bulk emails from a schedule using email templates.
What am I doing wrong?
Thanks
Jason
*************************************************************************************************************************
declare
v_placeholders clob;
lv_app_session number;
begin
apex_util.set_workspace('HEALTH');
begin
apex_session.create_session (p_app_id => :APP_ID
, p_page_id => 1
, p_username => :APP_USER);
end;
apex_json.initialize_clob_output;
apex_json.open_object;
apex_json.write('MESSAGE' , 'Hellow this is a test message');l
, p_template_static_id => 'NURSINGEMAIL'
, p_placeholders => v_placeholders
);
apex_mail.push_queue;
BEGIN
select v('APP_SESSION') into lv_app_session
from dual;
begin
apex_session.delete_session (p_session_id => lv_app_session);
end;
--EXCEPTION
--WHEN OTHERS THEN
--null; --need to add debug/error handling code here
END;
end;
*************************************************************************************************************************