예제 #1
0
 def send_support_message(self, subject, recipients, body, ticket_id):
   try:
     mail.send_message(subject, sender=self.sender, recipients=recipients, body=body)
   except Exception as e:
     raise Exception(e)
   msg = Message(user_id=self.user.id, support_ticket_id=ticket_id, sender_name=self.sender[0], sender_address=self.sender[1], subject=subject, body=body)
   msg.add()
예제 #2
0
 def send_support_confirmation_message(self):
   subject = 'Support Ticket Recieved'
   body = 'Hi {f_name},\nThis is just a confirmation message to say we got your message! All you have to do now is wait and we will get back to you ASAP!\n\nHave a wonderful day,\nKreoh Support'.format(f_name=self.user.f_name)
   try:
     mail.send_message(subject=subject, sender=self.sender, recipients=[self.user.email], body=body)
   except Exception as e:
     raise Exception(e)
   if self.user:
     msg = Message(user_id=self.user.id, sender_name=self.sender[0], sender_address=self.sender[1], subject=subject, body=body)
     msg.add()
예제 #3
0
  def send_email_verify_message(self):
    token = generate_confirmation_token(self.user.email)
    confirm_url = 'http://www.kreoh.com/u/confirm_email/' + token
    subject = 'Account Verification'
    body = 'Hi {f_name},\n\nYour almost ready to deploy your own website, simply follow the link below to get started:\n{confirm_url}\n\nThis link will expire in 1 hour. Once accepted you will have full access to all the features available with your Kreoh account.\nIf you did not request this activation link or you are not registered with our service, please ignore this email.\n\nKind Regards,\nKreoh Representative\nhttps://Kreoh.com'.format(f_name=self.user.f_name, confirm_url=confirm_url)

    ui_body = 'Hi {f_name},\n\nYour almost ready to deploy your own website, simply follow the link below to get started:\nSee Your Email For The Link\n\nThis link will expire in 1 hour. Once accepted you will have full access to all the features available with your Kreoh account.\nIf you did not request this activation link or you are not registered with our service, please ignore this email.\n\nKind Regards,\nKreoh Representative\nhttps://Kreoh.com'.format(f_name=self.user.f_name)

    try:
      mail.send_message(subject=subject, sender=self.sender, recipients=[self.user.email], body=body)
    except Exception as e:
      raise Exception(e)
    if self.user:
      msg = Message(user_id=self.user.id, sender_name=self.sender[0], sender_address=self.sender[1], subject=subject, body=ui_body)
      msg.add()
예제 #4
0
  def send_welcome_message(self):
    token = generate_confirmation_token(self.user.email)
    confirm_url = 'http://www.kreoh.com/u/confirm_email/' + token
    subject = 'Welcome To Kreoh!'
    body = 'Hi {f_name},\n\nMy name is Fareed, founder of Kreoh. Allow me use this as an opportunity to welcome you to the Kreoh Community!\n\nIn order for you to fully access all the features of Kreoh, simply follow the link below:\n\n{confirm_url}\n\nIf you need any help setting up simply reply to this email and I will get right back to you.\nIn fact, I would be happy to answer any questions you may have.\n\nAgain, thank you for joining us and welcome aboard!\n\n Best of luck,\nFareed'.format(f_name=self.user.f_name, confirm_url=confirm_url)

    ui_body = 'Hi {f_name},\n\nMy name is Fareed, founder of Kreoh. Allow me use this as an opportunity to welcome you to the Kreoh Community!\n\nIn order for you to fully access all the features of Kreoh, simply follow the link below:\n\nSee Your Email For The Link\n\nIf you need any help setting up simply reply to this email and I will get right back to you.\nIn fact, I would be happy to answer any questions you may have.\n\nAgain, thank you for joining us and welcome aboard!\n\n Best of luck,\nFareed'.format(f_name=self.user.f_name)

    try:
      mail.send_message(subject=subject, sender=self.sender, recipients=[self.user.email], body=body)
    except Exception as e:
      raise Exception(e)
    if self.user:
      msg = Message(user_id=self.user.id, sender_name=self.sender[0], sender_address=self.sender[1], subject=subject, body=ui_body)
      msg.add()
예제 #5
0
  def send_password_change_message(self, new_password):
    token = generate_confirmation_token(new_password)
    print(token)
    confirm_url = 'http://www.kreoh.com/u/confirm_password/' + token
    subject = 'Password Change Request'
    body = 'Hi {f_name},\n\nWe have recieved your password change request.\n\nFollow the link below to confirm:\n{confirm_url}\n\nThis link will expire in 1 hour. If you did not request this password change please secure account at https://Kreoh.com/secure_my_account .\n\nKind Regards,\nKreoh Representative\nhttps://Kreoh.com'.format(f_name=self.user.f_name, confirm_url=confirm_url)

    ui_body = 'Hi {f_name},\n\nWe have recieved your password change request.\n\nFollow the link below to confirm:\nSee Your Email For The Link\n\nThis link will expire in 1 hour. If you did not request this password change please secure account at https://Kreoh.com/secure_my_account .\n\nKind Regards,\nKreoh Representative\nhttps://Kreoh.com'.format(f_name=self.user.f_name)

    try:
      mail.send_message(subject=subject, sender=self.sender, recipients=[self.user.email], body=body)
    except Exception as e:
      raise Exception(e)
    if self.user:
      msg = Message(user_id=self.user.id, sender_name=self.sender[0], sender_address=self.sender[1], subject=subject, body=ui_body)
      msg.add()
예제 #6
0
파일: views.py 프로젝트: stanmpakati/talkme
def chatroom(request, username):
    if (request.method == "GET"):
        context = {"msgs": Message.objects.all().order_by("posted")}
        return render(request, "chatroom/chatroom.html", context)
    if (request.method == "POST"):
        msg = (request.POST['msg'])
        newMessage = Message()
        newMessage.owner = Person.objects.get(username=username)
        newMessage.msg = msg
        newMessage.save()
        return HttpResponse("200")