Exemplo n.º 1
0
def send_sms(message, from_phone, to):
    """
    Queue sms in SMSMessage model.
    """

    #demo override for testing purposes
    demo_to = GlobalConfig.get_or_none('demo_sms_phone')
    if demo_to:
        to = demo_to

    return SMSMessage.objects.create(
        message=message,
        from_phone=from_phone,
        to=to,
    )
Exemplo n.º 2
0
def send_sms(message, from_phone, to):

    """
    Queue sms in SMSMessage model.
    """

    #demo override for testing purposes
    demo_to = GlobalConfig.get_or_none('demo_sms_phone')
    if demo_to:
        to = demo_to

    return SMSMessage.objects.create(
        message=message,
        from_phone=from_phone,
        to=to,
    )
Exemplo n.º 3
0
def send_mail(subject, message, from_email, recipient_list):
    """
    Queue email in MailMessage model.
    """

    if isinstance(recipient_list, list):
        recipient_list = ';'.join(recipient_list)

    #demo override for testing purposes
    demo_to = GlobalConfig.get_or_none('demo_mail_emails')
    if demo_to:
        recipient_list = demo_to

    return MailMessage.objects.create(
        subject=subject,
        message=message,
        from_email=from_email,
        recipient_list=recipient_list,
    )
Exemplo n.º 4
0
def send_mail(subject, message, from_email, recipient_list):
    """
    Queue email in MailMessage model.
    """

    if isinstance(recipient_list, list):
        recipient_list = ';'.join(recipient_list)

    #demo override for testing purposes
    demo_to = GlobalConfig.get_or_none('demo_mail_emails')
    if demo_to:
        recipient_list = demo_to

    return MailMessage.objects.create(
        subject=subject,
        message=message,
        from_email=from_email,
        recipient_list=recipient_list,
    )
Exemplo n.º 5
0
def global_config(key, default=""):
    return GlobalConfig.get_or_none(key, default=default)
Exemplo n.º 6
0
def global_config(key, default=""):
        return GlobalConfig.get_or_none(key, default=default)