Saturday, 23 January 2016

Mail Level Approval Process

Direct Mail Approval is the trending process as we dont need to go back to application and then moving to approval process.
Steps involved in following process are:
Step:1:  Create application with authentication scheme as “No Authentication”. Also create a 
process for updation with point as before header. Updation process should be done with values 
in following items
         P1_SENDER      -  // Sender for whom updation needs to be done 
         P1_APPROVER   -  // Approver who approves the mail
         P1_STATUS       - // Status of Approval -whether approved /rejected
Step:2:  Create mail process with following PL/SQL Code which frames the content of     mail.
DECLARE
   lv_to_email     VARCHAR2 (100)   := 'richard.dalvi@doyensys.com';
   lv_from_email   VARCHAR2 (100)   := 'karthik.venkatachalam@doyensys.com';
   lv_body         VARCHAR2 (32767);
BEGIN
   lv_body :=
         '<html>
<body>
Hi,'
      || CHR (10)
      || 'Kindly Approve my leave on 15-DEC-2015'
      || CHR (10)
      || '<br/>
<br/><a href="https://apex.oracle.com/pls/apex/f?p=24370:1:&SESSION.::&DEBUG.:P1_TO_EMAIL,P1_STATUS,P1_FROM_EMAIL:'
      || lv_from_email
      || ',Approved,'
      || lv_to_email
      || '" id="h1"><button>Approve</button></a> <a href="https://apex.oracle.com/pls/apex/f?p=24370:1:&SESSION.::&DEBUG.:P1_TO_EMAIL,P1_STATUS,P1_FROM_EMAIL:'
      || lv_from_email
      || ',Rejected,'
      || lv_to_email
      || '" id="h1"><button>Reject</button></a></body>
</html>';
   DBMS_OUTPUT.put_line (lv_body);
   apex_mail.send (p_to             => lv_to_email,
                   p_from           => lv_from_email,
                   p_subj           => 'Leave request',
                   p_body           => '',
                   p_body_html      => lv_body
                  );
END;

1 comment:

  1. can you explain complete flow of Mail Level Approval

    ReplyDelete