def send_now(users, label, extra_context=None, sender=None):
sent = False<EOL>if extra_context is None:<EOL><INDENT>extra_context = {}<EOL><DEDENT>notice_type = NoticeType.objects.get(label=label)<EOL>current_language = get_language()<EOL>for user in users:<EOL><INDENT>try:<EOL><INDENT>language = get_notification_language(user)<EOL><DEDENT>except LanguageStoreNotAvailable:<EOL><INDENT>language = None<EOL><DEDENT>if language is not None:<EOL><INDENT>activate(language)<EOL><DEDENT>for backend in NOTIFICATION_BACKENDS.values():<EOL><INDENT>if backend.can_send(user, notice_type):<EOL><INDENT>backend.deliver(user, sender, notice_type, extra_context)<EOL>sent = True<EOL><DEDENT><DEDENT><DEDENT>activate(current_language)<EOL>return sent<EOL>
Creates a new notice.

This is intended to be how other apps create new notices.

notification.send(user, "friends_invite_sent", {
    "spam": "eggs",
    "foo": "bar",
)