i have written a trigger for email
CREATE OR REPLACE TRIGGER "EMAIL"
AFTER
update on "LEAVE_APPLICATION"
for each row
begin
if :new.status='Approve' then
for c1 in (select FIRST_NAME,LAST_NAME,DESIGNATION,EMAIL from EMPLOYEE_DETAILS
where EMPLOYEE_ID=:new.EMPLOYEE_ID)
loop
APEX_MAIL.SEND(
p_to =>c1.email,
p_from=>'XXX@xxxx.com',
p_body=>
'Leave Details: '||chr(10)||'Details Below are :'||chr(10)||
chr(10)||
'Leave ID:'||:new.LEAVAPPLICATION_ID||chr(10)||
'Emplyee ID:'||:new.employee_id||chr(10)||
'Employee Name:'||:new.employee_name||chr(10)||
'Leave Type:'||:new.LEAVE_TYPE||chr(10)||
'Date From :'||:new.DATE_FROM||chr(10)||
'Date To:'||:new.DATE_TO||chr(10)||
'No of Days:'||:new.no_of_working_days||chr(10)||
chr(10)||
'Status:'||:new.status||chr(10),
p_subj=>'Leave Details :');
end loop;
end;
my question is where should i add this code
wwv_flow_mail.push_queue(
P_SMTP_HOSTNAME => 'ip',
P_SMTP_PORTNO => 'port');