P
P
Paul Mikhalev2015-07-14 18:53:04
PHP
Paul Mikhalev, 2015-07-14 18:53:04

How to send email in json format using phpmailer?

I'm trying to link a form on the site with Pipedrive so that user requests immediately fall into the system, and not on email requests, but Pipedrive asks me to send him letters in JSON. I can't figure out how to send an email in JSON

$mail->isSMTP();
$mail->Host = 'smtp';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'pass';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;

$mail->FromName = 'REGISTRATION';
$mail->From = '[email protected]';

$mail->addAddress('[email protected]');

$mail->isHTML(true);

$mail->Subject = "Новая регистрация | $_POST[regemail]";
$mail->Body    = '{ 
 "item_type": "deal",
 "title": "Новая регистрация",
 "organization": $_POST[regcompname],
 "value": 0, "currency": "USD",
 "owner": "[email protected]",
 "person": { "name": $_POST[regname],
 "email": $_POST[regemail],
 "organization": $_POST[regcompname],
 "phone": $_POST[regphone] }
}';

Pipedrive itself emails the details of the error

Hi,
We are sorry, but we could not find a owner for the given object:
""
If you want this object to be added to Pipedrive system, please fill or add the "owner" field and send again.

That is, it comes in the wrong format, since it does not see anything. How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2015-07-14
@LorD_Noka

Now I have seen everything.
There is also a normal API. What a perversion with json letter.
https://developers.pipedrive.com/v1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question