I have a templated called ‘REGISTRATION’ in my Shared Components | Email Templates. I would like to send emails based on it.
This code works, so I know my email system works...
apex_mail.send
(
p_to => P_SEND_TO,
p_from => 'noreply@company.com',
p_subj => P_SUBJECT_LINE,
p_body => P_MESSAGE_BODY_HTML ,
p_body_html => P_MESSAGE_BODY_HTML
);
I wanted to use a template and found an example. This is what I started with, but it did not send any emails. Does it need to be sent from APEX or can I call it from SQL developer directly? Does it need the application context for the p_template_static_id to mean anything? Do I need quotes around the value or is there some error in my place holders value?
apex_mail.send(
p_to => P_SEND_TO,
p_from => 'noreply@company.com',
p_template_static_id => 'REGISTRATION',
p_placeholders => '{ORDER_ID,TEST}');
In any case, I got a suggestion to use apex_mail.t_varchar2, but I get an Error(58,37): PLS-00302: component 'T_VARCHAR2' must be declared
apex_mail.send(
p_to => P_SEND_TO,
p_from => 'noreply@company.com',
p_template_static_id => 'REGISTRATION',
p_placeholders => apex_mail.t_varchar2('ORDER_ID', 'TEST'));
Bottom line, I can use the HTML body technique, but I cannot seem to use the template technique.
Ideas?