Notification similar to django-notification

98 views
Skip to first unread message

billmac...@gmail.com

unread,
May 13, 2016, 10:14:26 AM5/13/16
to web2py-users
Is there a plugin/package for web2py that is similar to django-notification for emails, texts and other activities?

eric cuver

unread,
May 20, 2016, 10:33:56 AM5/20/16
to web2py-users
you can give the django notifcation links to see 

billmac...@gmail.com

unread,
May 30, 2016, 12:33:23 AM5/30/16
to web2py-users
You can look at facebook notification, basically an interface where user pick how they want to receive their notification, by email or texts etc. Toggle them on and off and when they log into their dashboard they see the notifications and receive them as they have it set up in their settings. Its pretty standard for big applications. But since its a volunteer driven org/framework, it may be its not possible to get a package like that.

eric cuver

unread,
May 30, 2016, 3:50:19 AM5/30/16
to web2py-users
you can use api notification html 5  or other APIs such as notification http://docs.localytics.com/index.html

pbreit

unread,
Jun 2, 2016, 2:21:38 AM6/2/16
to web2py-users
There's a facility for sending email:

Here is my code that sends SMSes through 4 services:

def send_sms(provider, src, dst, txt, uid, uname, pword):

    import urllib, json, base64, requests


    if provider=='plivo':
        data = json.dumps({'src': src, 'dst': dst, 'text': txt})
        url = settings.plivo_send % uname
        headers = {'Content-Type': 'application/json',
            'Authorization': 'Basic %s' % base64.b64encode('%s:%s' % (uname, pword))}

    if provider=='twilio':
        data = urllib.urlencode({'From': '+%s' % src, 'To': dst, 'Body': txt})
        url = settings.twilio_send % uname
        headers = {'Authorization': 'Basic %s' % base64.b64encode('%s:%s' % (uname, pword))}

    if provider=='bandwidth':
        data = json.dumps({'from': '+%s' % src, 'to': '+%s' % dst, 'text': txt})
        logger.debug(settings.bandwidth_send % uid)
        url = settings.bandwidth_send % uid
        headers = {'Content-Type': 'application/json',
            'Authorization': 'Basic %s' % base64.b64encode('%s:%s' % (uname, pword))}

    if provider=='nexmo':
        url = settings.nexmo_send % (uid, uname, src, dst, txt)

    r = requests.post(url=url, headers=headers, data=data)

    return r
Reply all
Reply to author
Forward
0 new messages