protected function setSmtpApi(&$data, Swift_Mime_SimpleMessage $message)
    {
        foreach ($message->getChildren() as $attachment) {
            if (!$attachment instanceof Swift_Image
                || !in_array(self::SMTP_API_NAME, [$attachment->getFilename(), $attachment->getContentType()])
            ) {
                continue;
            }
            $data['x-smtpapi'] = json_encode($attachment->getBody());
        }
    }