25.5 PREPARE_TEMPLATE Procedure

Procedure to return a formatted mail based on an e-mail template where the placeholders specified as json string are substituted.

Syntax

PROCEDURE PREPARE_TEMPLATE (
     p_static_id         IN VARCHAR2,
     p_placeholders      IN CLOB,
     p_application_id    IN NUMBER DEFAULT, 
     p_subject           OUT VARCHAR2,
     p_html              OUT CLOB,
     p_text              OUT CLOB );

Parameters

Table 25-2 PREPARE_TEMPLATE Parameters

Parameters Description

p_static_id

p_placeholders

p_application_id

p_subject

p_html

p_text

Example

declare
  l_subject varchar2( 4000 );
  l_html    clob;
  l_text    clob;
begin
  apex_mail.prepare_template (
  p_static_id    => 'ORDER',
  p_placeholders => '{ "ORDER_NUMBER": 5321, "ORDER_DATE": "01-Feb-2018", "ORDER_TOTAL": "$12,000" }',
  p_subject      => l_subject,
  p_html         => l_html,
  p_text         => l_text );
end;