'Send a message to a user.'

def send_message(self, message='', **kwargs):

    data = {self._message_param_name: message}
    if (self._title_param_name is not None):
        data[self._title_param_name] = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)
    if ((self._target_param_name is not None) and (ATTR_TARGET in kwargs)):
        data[self._target_param_name] = kwargs[ATTR_TARGET][0]
    if self._data:
        data.update(self._data)
    elif self._data_template:
        def _data_template_creator(value):
            'Recursive    template    creator    helper    function.'
            if isinstance(value, list):
                return [_data_template_creator(item) for item in value]
            elif isinstance(value, dict):
                return {key: _data_template_creator(item) for (key, item) in value.items()}
            value.hass = self._hass
            return value.async_render(kwargs)
        data.update(_data_template_creator(self._data_template))
    if (self._method == 'POST'):
        response = requests.post(self._resource, data=data, timeout=10)
    elif (self._method == 'POST_JSON'):
        response = requests.post(self._resource, json=data, timeout=10)
    else:
        response = requests.get(self._resource, params=data, timeout=10)
    if (response.status_code not in (200, 201)):
        _LOGGER.exception('Error    sending    message.    Response    %d:    %s:', response.status_code, response.reason)
