'Send a notification out to the given `notifiers` with a given `title` and `message`.
If `template_renderer` is specified, `title`, `message`, as well as any string options in a notifier\'s config
will be rendered using this function before sending the message.
:param str title: Title of the notification. (some notifiers may ignore this)
:param str message: Main body of the notification.
:param list notifiers: A list of configured notifier output plugins. The `NOTIFY_VIA_SCHEMA` JSON schema
describes the data structure for this parameter.
:param template_renderer: A function that should be used to render any jinja strings in the configuration.'

def send_notification(self, title, message, notifiers, template_renderer=None):

    if template_renderer:
        try:
            title = template_renderer(title)
        except RenderError as e:
            log.error(u'Error    rendering    notification    title:    %s', e)
        try:
            message = template_renderer(message)
        except RenderError as e:
            log.error(u'Error    rendering    notification    body:    %s', e)
    for notifier in notifiers:
        for (notifier_name, notifier_config) in notifier.items():
            notifier = plugin.get_plugin_by_name(notifier_name).instance
            rendered_config = notifier_config
            if template_renderer:
                try:
                    rendered_config = render_config(notifier_config, template_renderer)
                except RenderError as e:
                    log.error(u'Error    rendering    %s    plugin    config    field    %s:    %s', notifier_name, e.config_path, e)
            log.debug(u'Sending    a    notification    to    `%s`', notifier_name)
            try:
                notifier.notify(title, message, rendered_config)
            except PluginWarning as e:
                log.warning(u'Error    while    sending    notification    to    `%s`:    %s', notifier_name, e.value)
            else:
                log.verbose(u'Successfully    sent    a    notification    to    `%s`', notifier_name)
