Skip Navigation
Expand
Sending emails from PHP Customizations using the Mail API
Answer ID 12321   |   Last Review Date

Environment:

Connect for PHP (CPHP) API, Process Designer, Custom Process Model (CPM) / Service Process Model (SPM)
All product versions

Resolution:

The Connect for PHP (CPHP) API can be used to send custom emails using the Mail API. The Mail API has been designed to send email notifications or for smaller email integration scenarios, therefore, we do not recommend using this API for mass mailings, marketing emails, or other high-volume emails.

Instead, the Mailing::SendMailingToContact function can be used from CPHP when the Feedback and Outreach modules are enabled in Oracle B2C Service. It can be used to send a transactional mailing or survey to a contact from CPHP.

The Mail API can be used to send custom emails to Oracle B2C Service contacts, and may be the best option for scenarios not covered by the use of Message Templates. For information specific to Message Templates see

Answer ID 5380:  Customizing notifications and email messages sent by Oracle B2C Service

As with email functionality supported by the base-product (ie. not using customization or APIs), site configuration is an important factor when using the Mail API. However, the Mail API is different in that emails sent from it do not include an email tracking string as do emails sent using Message Templates.

One important configuration to consider is EGW_SECURE_UPDATE_MODE, as a setting of 1 requires a tracking string to be present in the message sent from MailMessage (which it isn't). Thus, for managing the create/update of incidents on replies from emails sent using the Mail API, this configuration should be set to either 0 or 2.

Supported values are:

0 - updating an incident by email is allowed from any email address based on reference number match only. IMPORTANT! SETTING THIS VALUE TO 0 MAY IMPACT SECURITY OR PRIVACY CONCERNS FOR YOUR SITE.

1 - updating an incident by email is allowed from any email address only if the originating message includes a tracking string indicating a match to the site and incident in question. If value is set to 1, an incident can also be updated by the contact as in 2.

2 - updating an incident by email is allowed only when the Reply-to or From address of the email message is listed in the contact record associated with the incident (that is, the primary or alternate email addresses).

The EGW_UPDATE_BY_CREATE configuration can also be a factor, as described here

Answer ID 1457:  Allowing other contacts to update incidents

For further details on the Mail API see

Answer ID 10102:  Mail API per-process limit of 200 emails