Documente Academic
Documente Profesional
Documente Cultură
to keep in
mind from best practices to new additional methods that can be useful in different purpose. I am trying to cover all
the different aspects of sending emails, this will be Bible for sending emails in the PeopleSoft.
Best Practice
1) Anything that works is not correct or best method to follow while writing the PeopleCode. First thing comes to
the mind - SendMail function to send the email, it is an deprecated method and should not be used. Application
Class MCFOutboundEmail needs to be used and it is the fully SMTP Protocol compliant to RFC 821/822. It
uses Javamail functionality using this package.
Where to Configure
MCFOutBoundEmail() function uses the SMTP section of the Application Server's psappsrv.cfg file, and Process
Scheduler's SMTP section of the psprcs.cfg file, just as the SendMail() function does. No special configuration is
required for the MCFOutboundEmail() function to work.
Debugging
In case if mails are not working for you and you are not able to figure out the issue.
You should look into smtp logs for more details and it will tell you exactly what is happening.
Before using the SMTP logs , you need to enable it.
For enabling SMTP logs for App Server you need to edit the app server configuration file :psappsrv.cfg.
Open the psappsrv.cfg file and find “SMTP”.Look for SMTPTrace variable.
It will be SMTPTrace=0 initially.
Set the value of this variable SMTPTrace=1 and save the file.
This change does not require a Application Server boot and changes will be reflected immediately.
If you are using mail classes from Process Scheduler, you may need to set their trace also.
The psprcs.cfg file needs to be modified for this.
Open the file and look for SMTP and change the settings as done in the App server configuration file.
It will generate Trace file SMTP.LOG in LOGS Folder under
$PS_HOMEappservdomain_namelogsSMTP.LOG for Appserver and
$PS_HOMEappservprcsdomain_namelogsSMTP.LOG for Batchserver.
2) Notification Framework Another option is not explored very well by developers to send emails. It can be easy
way sending the email for many scenarios, where code can be simple and provide configurable options.
The Notifications Framework uses the generic templates of the PeopleTools Workflow Technology, and the
reader is urged to review the information in PeopleTools: Workflow Technology, “Using Notification Templates,”
for a more comprehensive understanding.
Entity Registry to generalize all notifications into a single structure. The architecture is modeled on a pluggable
channel-based approach. Each notification type is supported by a dedicated channel that supports the
idiosyncrasies of the particular notification type.
Notification Setup page (select Set Up SACR, then select System Administration, then select Utilities, then select
Notifications, then select Notification Setup)
Notification Consumer Setup page (select Set Up SACR, then select System Administration, then select Utilities,
then select Notifications, then select Notification Consumer Setup).
Write an AppClass that extends AbstractNotification class. The Consumer ID must be passed to the Super Class
constructor
Implement the abstract method createNtfContext().
Implement the abstract method populateNtfContext(). This method populates the context create above with the
necessary values
Invoke the send(), remind(), or resend() methods.
Override the OnSuccess() and OnError() for custom behavior
Consultants can refer to the Delegated Access Application Class SCC_DA:NOTIFY as a reference for how to
trigger the Notifications Framework as a consumer.