Sending Email Notifications

Hi there, I’m battling to get an email notification sent on new lead creation.

I’ve setup a notification in the cutom-hooks directory

The hook executes when a new lead is created

But the notification does not get sent out.

  1. My first question: is the noification being sent out by sendmail or SMTP? Is this configurable in Splynx?
  2. If SMTP, where do I see the logs?

Here is my php file:


defined(‘STDIN’) OR define(‘STDIN’, fopen(‘php://stdin’, ‘r’));

$data = fgets(STDIN);

$data = json_decode($data, true);

file_put_contents(“/tmp/splynx_hook_debug”, print_r($data, TRUE));

//Grab stdin

defined (‘STDIN’) OR define( ‘STDIN’, fopen(‘php://stdin’, ‘r’));

$data = fgets (STDIN) ;

$data = json_decode($data, true);


*** to send email edit this block**


$model = print_r($data,1); //print data-array

//send email

$to = ; //set your email

$subject = “Splynx test send-mailer”;

$message = "{$model} \n

New Lead **“{$data[‘attributes’][‘name’]}"** was created {$data[‘date’]} by {$data[‘source’]}”;

$headers = “From: Admin\r\n”;

mail($to, $subject, $message, $headers);