def send_message_to_all_users(post): for user in db.find_all(User): smtp_obj = smtplib.SMTP("localhost") for user in db.find_all(User): if not user["email"]: continue send_message(post.posts, user, smtp_obj)
def send_sms_to_all_users(post): for user in db.find_all(User): send_message(user, post.posts)