# Path: yak/settings.py
# def perform_import(val, setting_name):
#     def __getattr__(self, attr):
# class YAKAPISettings(APISettings):
# USER_SETTINGS = getattr(settings, 'YAK', None)
# DEFAULTS = {
#     'USER_APP_LABEL': 'test_app',
#     'USER_MODEL': 'user',
#     'USER_SERIALIZER': "test_app.api.serializers.UserSerializer",
#     'API_SCHEMA': 'api-schema-1.0.json',
#     'SOCIAL_MODEL': "test_app.models.Post",
#     'ALLOW_EMAIL': True,
#     'ALLOW_PUSH': True,
#     'EMAIL_NOTIFICATION_SUBJECT': 'Test Project Notification',
#     'PUSHWOOSH_AUTH_TOKEN': "",
#     'PUSHWOOSH_APP_CODE': "",
#     'PUSH_NOTIFICATION_HANDLER': "yak.rest_notifications.utils.send_pushwoosh_notification",
#     'SOCIAL_SHARE_DELAY': 60,
#     'USE_FACEBOOK_OG': False,
#     'FACEBOOK_OG_NAMESPACE': "",
#     'SERIALIZER_MAPPING': {},
#     'FLAKE8_CONFIG': None,
# }
# IMPORT_STRINGS = (
#     "USER_SERIALIZER",
#     "SOCIAL_MODEL",
#     "SERIALIZER_MAPPING",
# )


import json
import requests
from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.utils.html import strip_tags
from django.utils.module_loading import import_string
from pypushwoosh import constants
from pypushwoosh.client import PushwooshClient
from yak.settings import yak_settings
        'devices': [token.token for token in receiver.pushwoosh_tokens.all()],
        'ios_badges': '+1'
    }

    if deep_link is not None:
        notification_data['minimize_link'] = 0
        notification_data['link'] = deep_link

    request = {'request': {
        'notifications': [notification_data],
        'auth': yak_settings.PUSHWOOSH_AUTH_TOKEN,
        'application': yak_settings.PUSHWOOSH_APP_CODE
    }}

    request_data = json.dumps(request)

    return submit_to_pushwoosh(request_data)


def send_push_notification(receiver, message, deep_link=None):
    notification_handler = import_string(yak_settings.PUSH_NOTIFICATION_HANDLER)
    return notification_handler(receiver, message, deep_link=None)


def send_email_notification(receiver, message, reply_to=None):
    headers = {}
    if reply_to:
        headers['Reply-To'] = reply_to

    text_content = strip_tags(message)

# Path: yak/settings.py
# def perform_import(val, setting_name):
#     def __getattr__(self, attr):
# class YAKAPISettings(APISettings):
# USER_SETTINGS = getattr(settings, 'YAK', None)
# DEFAULTS = {
#     'USER_APP_LABEL': 'test_app',
#     'USER_MODEL': 'user',
#     'USER_SERIALIZER': "test_app.api.serializers.UserSerializer",
#     'API_SCHEMA': 'api-schema-1.0.json',
#     'SOCIAL_MODEL': "test_app.models.Post",
#     'ALLOW_EMAIL': True,
#     'ALLOW_PUSH': True,
#     'EMAIL_NOTIFICATION_SUBJECT': 'Test Project Notification',
#     'PUSHWOOSH_AUTH_TOKEN': "",
#     'PUSHWOOSH_APP_CODE': "",
#     'PUSH_NOTIFICATION_HANDLER': "yak.rest_notifications.utils.send_pushwoosh_notification",
#     'SOCIAL_SHARE_DELAY': 60,
#     'USE_FACEBOOK_OG': False,
#     'FACEBOOK_OG_NAMESPACE': "",
#     'SERIALIZER_MAPPING': {},
#     'FLAKE8_CONFIG': None,
# }
# IMPORT_STRINGS = (
#     "USER_SERIALIZER",
#     "SOCIAL_MODEL",
#     "SERIALIZER_MAPPING",
# )


# Path: yak/rest_notifications/utils.py
import json
import requests
from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.utils.html import strip_tags
from django.utils.module_loading import import_string
from pypushwoosh import constants
from pypushwoosh.client import PushwooshClient
from yak.settings import yak_settings

        'devices': [token.token for token in receiver.pushwoosh_tokens.all()],
        'ios_badges': '+1'
    }

    if deep_link is not None:
        notification_data['minimize_link'] = 0
        notification_data['link'] = deep_link

    request = {'request': {
        'notifications': [notification_data],
        'auth': yak_settings.PUSHWOOSH_AUTH_TOKEN,
        'application': yak_settings.PUSHWOOSH_APP_CODE
    }}

    request_data = json.dumps(request)

    return submit_to_pushwoosh(request_data)


def send_push_notification(receiver, message, deep_link=None):
    notification_handler = import_string(yak_settings.PUSH_NOTIFICATION_HANDLER)
    return notification_handler(receiver, message, deep_link=None)


def send_email_notification(receiver, message, reply_to=None):
    headers = {}
    if reply_to:
        headers['Reply-To'] = reply_to

    text_content = strip_tags(message)

    msg = EmailMultiAlternatives(yak_settings.EMAIL_NOTIFICATION_SUBJECT, text_content, settings.DEFAULT_FROM_EMAIL,