Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

PHP to update incident email (1 Comment)

$
0
0

Topic by Dudu Dahan

Hello,

We develop some PHP code in order to support Business Rule,

Rule is the following:

Customer receives an automated email that send from our company email (not related to Oracle), and on the email subject there is the customer email, example:

"9/21/2017 Form - order id, Tom B sadkasdk@gmail.com"

and we would like to copy/replace the customer email from the subject (bold) and put it into the customer/contact email (replace the original system company address email).

 

In PHP code we divide it into 2 parts, first we enter it to custom field (works great) and second part, to enter to the email address (where we are facing the issues).

 

Attached is a sample code for the relevant part: (the bold part is the place where we are facing the issue), thank you for you help.

$text = $object->Subject;
$regex = "/[a-z0-9_\-\+]+@[a-z0-9\-]+\.([a-z]{2,3})(?:\.[a-z]{2})?/i";
preg_match($regex,$text,$name);
$object->CustomFields->c->subject_cf = $name[0];
$contact->Emails[0]->Address = $name[0];

Viewing all articles
Browse latest Browse all 2504

Trending Articles