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()
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()
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()
def Worker_welcomeEmail(user): ctx = app.test_request_context() ctx.push() ## WORK START ## notifications = Notifications(test=False) notifications.sendWelcomeEmail(user) ## WORK END ## ctx.pop()
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()
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."