public function formatTemplateMessage ($templateID, $openID, $url, array $data, array $options = [])
    {
        $json = [
            'touser'      => (string)$openID,
            'template_id' => (string)$templateID,
            'url'         => (string)$url,
            'data'        => [],
        ];

        if (isset($options['color'])) {
            $json['topcolor'] = '#' . strtoupper(ltrim($options['color'], '#'));
        }

        foreach ($data as $fieldName => $fieldValue) {
            if (! is_array($fieldValue)) {
                $json['data'][$fieldName] = ['value' => $fieldValue];
            } else {
                $json['data'][$fieldName] = [
                    'value' => $fieldValue['value'],
                ];

                if (isset($fieldValue['color'])) {
                    $json['data'][$fieldName]['color'] = '#' . strtoupper(ltrim($fieldValue['color'], '#'));
                }
            }
        }

        return $json;
    }