Hi,
I have created an incoming webhook which creates a entry in GF, currently I am sending over user data which isn’t a problem but sometimes a file will need to be attached and sent then accessed from WP.
On my PHP script I have created the JSON which is sent over and added the attachment to this but I am not sure how this is going to send it, I hope that makes sense?
Below is my PHP variable encoding into JSON which is then sent to GF Incoming webhook via CURL.
$json_data = json_encode([
// Message
'emailSubject' => $emailSubject,
'emailHtml' => $emailHtml,
'emailMessageId' => $emailMessageId,
'emailToAddress' => $emailToAddress,
'emailFromAddress' => $emailFromAddress,
'emailReplyToAddress' => $emailReplyToAddress,
'emailSenderAddress' => $emailSenderAddress,
'emailRecent' => $emailRecent,
'emailUnseen' => $emailUnseen,
'emailFlagged' => $emailFlagged,
'emailMailDate' => $emailMailDate,
'emailSize' => $emailSize,
'attachment_1' => $attachments[0]['filename']
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );