There are two ways to attach files to a message in “textarea”. Both methods work, but in different ways.
We can send an email to “SendGrid”
“SendGrid” can redirect incoming data to “Webhook”
As a result, our “Webhook” receives j son with various information. Including information about attached files, example
[attachment-info] => {“attachment1”:{“filename”:“value_this-Dec-23-2024-01-39-53-6416-PM.jpg”,“name”:“value_this-Dec-23-2024-01-39-53-6416-PM.jpg”,“type”:“image/jpeg”,"content-id ":“603fb66dc75ec2c03c907fbd5656b712”},“attachment2”:{“filename”:“configcat-logo-ver t-400x272-Dec-23-2024-01-39-03-5448-PM.png”,“name”:“configcat-logo-vert-400x272-Dec- 23-2024-01-39-03-5448-PM.png”,“type”:“image/png”,“content-id”:“a700d9dfccd57e8fa52c1e602f177912”},“attachment3”:{“filename”:“configcat-logo-vert-400x272-Dec-23-20 24-01-38-49-3104-PM.png”,“name”:“configcat-logo-vert-400x272-Dec-23-2024-01-38-49 -3104-PM.png”,“type”:“image/png”,“content-id”:“e4059e1f2d71b86b02c1d90e38e0d01a”}}
Problem is that the information contains both old files and new ones.
And so the array can grow. Depending on how we attach the file (paper clip or in the content), the array can change the order. That is, a new file can be added either to the end of the array or to the beginning.. And it is quite difficult to track.
Perhaps there is a setting in “Hubspot” that will allow you to disable the transmission of [attachment-info] with old attachments in order to catch only new ones.
$_FILE - also shows all old files.
Thanks