A php library for the sendgrid parse api. It's really more convention than code.
- Clone the repository or copy the php file into your project.
- Include the php file.
After your router identified the request as coming from SendGrid, you can parse the incoming data as follows:
$parsed = new SendgridParse();
You can then access all attributes of the incoming email as attributes of $parsed
. The following attributes get special treatment:
$parsed->from
: an array that maps "name" to the name, "email" to the email address and "full" to the combination of both;$parsed->to
: an array of all to-recipients - each recipient is treated by an array that maps "name", "email" and "full" again;$parsed->cc
: same thing for the cc-recipients;$parsed->attachments
: an array of all attachments - each attachment is a record for an uploaded file.