Beispiel #1
0
def Worker_visionLikeEmail(user, liker, vision):
    ctx = app.test_request_context()
    ctx.push()

    ## WORK START ##
    notifications = Notifications(test=False)
    notifications.sendVisionLikeEmail(user, liker, vision)
    ## WORK END ##

    ctx.pop()
Beispiel #2
0
def Worker_commentEmail(authorUser, vision, comment):
    ctx = app.test_request_context()
    ctx.push()

    ## WORK START ##
    notifications = Notifications(test=False)
    notifications.sendCommentEmail(authorUser, vision, comment)
    ## WORK END ##

    ctx.pop()
Beispiel #3
0
def Worker_repostEmail(user, origVision, newVision):
    ctx = app.test_request_context()
    ctx.push()

    ## WORK START ##
    notifications = Notifications(test=False)
    notifications.sendRepostEmail(user, origVision, newVision)
    ## WORK END ##

    ctx.pop()
Beispiel #4
0
def Worker_welcomeEmail(user):
    ctx = app.test_request_context()
    ctx.push()

    ## WORK START ##
    notifications = Notifications(test=False)
    notifications.sendWelcomeEmail(user)
    ## WORK END ##

    ctx.pop()
Beispiel #5
0
def Worker_followEmail(follower, user):
    ctx = app.test_request_context()
    ctx.push()

    ## WORK START ##
    notifications = Notifications(test=False)
    notifications.sendFollowEmail(follower, user)
    ## WORK END ##

    ctx.pop()
Beispiel #6
0
def test_email(emailType):
    if request.method == 'GET':
        userInfo = None
        if SessionManager.userLoggedIn():
            userInfo = SessionManager.getUser()
            user = User.getById(userInfo['id'])
            if user and user.isAdmin():
                notification = Notifications()
                if emailType == "daily":
                    return notification.testDailyEmail()
                elif emailType == "welcome":
                    return notification.testWelcomeEmail(userInfo)
    return "Hello."