Difference between revisions of "Email Notification Configuration"

From SmartHCM Wiki
Jump to navigation Jump to search
(Created page with "<pre> -- Connect Sys user and execute following GRANT EXECUTE ON UTL_HTTP to SMARTHCM_SADAD; GRANT EXECUTE ON UTL_TCP to SMARTHCM_SADAD; GRANT EXECUTE ON UTL_SMTP to SMARTHCM_...")
 
Line 1: Line 1:
 +
Connect Sys user with SYSDBA rights and execute following
 
<pre>
 
<pre>
-- Connect Sys user and execute following
 
 
GRANT EXECUTE ON UTL_HTTP to SMARTHCM_SADAD;
 
GRANT EXECUTE ON UTL_HTTP to SMARTHCM_SADAD;
 
GRANT EXECUTE ON UTL_TCP to SMARTHCM_SADAD;
 
GRANT EXECUTE ON UTL_TCP to SMARTHCM_SADAD;
 
GRANT EXECUTE ON UTL_SMTP to SMARTHCM_SADAD;
 
GRANT EXECUTE ON UTL_SMTP to SMARTHCM_SADAD;
 
GRANT EXECUTE ON UTL_INADDR to SMARTHCM_SADAD;
 
GRANT EXECUTE ON UTL_INADDR to SMARTHCM_SADAD;
+
</pre>
 +
 
 +
Connect System user and execute following
 +
<pre>
 
begin
 
begin
 
   dbms_network_acl_admin.create_acl (
 
   dbms_network_acl_admin.create_acl (
Line 37: Line 40:
 
end;
 
end;
 
/
 
/
 +
</pre>
  
-- Test it
+
Test it using below;
 +
<pre>
 
begin
 
begin
 
   -- Call the procedure
 
   -- Call the procedure
Line 48: Line 53:
 
                                       'Testing Email Body Message');
 
                                       'Testing Email Body Message');
 
end;
 
end;
 +
</pre>
  
  
-- To verify the above script is successfully executed  
+
To verify the above script is successfully executed;
 +
<pre>
 
SELECT * FROM dba_network_acl_privileges;
 
SELECT * FROM dba_network_acl_privileges;
 
SELECT * FROM dba_network_acls;  
 
SELECT * FROM dba_network_acls;  

Revision as of 13:31, 12 July 2017

Connect Sys user with SYSDBA rights and execute following

GRANT EXECUTE ON UTL_HTTP to SMARTHCM_SADAD;
GRANT EXECUTE ON UTL_TCP to SMARTHCM_SADAD;
GRANT EXECUTE ON UTL_SMTP to SMARTHCM_SADAD;
GRANT EXECUTE ON UTL_INADDR to SMARTHCM_SADAD;

Connect System user and execute following

begin
  dbms_network_acl_admin.create_acl (
    acl         => 'SendEmailService.xml',
    description => 'Send Email via Webservice',
    principal   => 'SMARTHCM_SADAD',
    is_grant    => TRUE,
    privilege   => 'connect'
    );
    commit;
end;
/

begin
  dbms_network_acl_admin.add_privilege (
  acl       => 'SendEmailService.xml',
  principal => 'SMARTHCM_SADAD',
  is_grant  => TRUE,
  privilege => 'resolve'
  );
  commit;
end;
/

begin
  dbms_network_acl_admin.assign_acl(
  acl  => 'SendEmailService.xml',
  host => 'sadad.smarthcm.com'
  );
  commit;
end;
/

Test it using below;

begin
  -- Call the procedure
  set_send_email_pkg.send_email_via_wc('smtp.gmail.com',
                                       '587',
                                       'sadad.smarthcm.com@gmail.com',
                                       'usman@sofdigital.com',
                                       'Testing Email Subject',
                                       'Testing Email Body Message');
end;


To verify the above script is successfully executed;

SELECT * FROM dba_network_acl_privileges;
SELECT * FROM dba_network_acls; 


Note:

  • Where “host” is the IP of the Email Server (‘*’ means auto find the specific email server)
  • Where “principal” is the Schema / Database Username where import the database