Added URL
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
FLASK_APP=project/__init__.py
|
FLASK_APP=project/__init__.py
|
||||||
FLASK_DEBUG=1
|
FLASK_DEBUG=1
|
||||||
SOCKET_URL=https://dev-socket.mermsemr.com
|
SOCKET_URL=https://dev-socket.mermsemr.com
|
||||||
|
PANEL_URL=https://dev-panel.mermsemr.com
|
||||||
DATABASE_URL=postgresql://merms_panel:merms_panel@10.20.30.60:5432/merms_panel
|
DATABASE_URL=postgresql://merms_panel:merms_panel@10.20.30.60:5432/merms_panel
|
||||||
SQL_HOST=10.20.30.60
|
SQL_HOST=10.20.30.60
|
||||||
SQL_PORT=5432
|
SQL_PORT=5432
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
FLASK_APP=project/__init__.py
|
FLASK_APP=project/__init__.py
|
||||||
FLASK_DEBUG=1
|
FLASK_DEBUG=1
|
||||||
SOCKET_URL=https://dev-socket.mermsemr.com
|
SOCKET_URL=https://dev-socket.mermsemr.com
|
||||||
|
PANEL_URL=https://dev-panel.mermsemr.com
|
||||||
DATABASE_URL=postgresql://merms_panel:merms_panel@10.20.30.60:5432/merms_panel
|
DATABASE_URL=postgresql://merms_panel:merms_panel@10.20.30.60:5432/merms_panel
|
||||||
SQL_HOST=10.20.30.60
|
SQL_HOST=10.20.30.60
|
||||||
SQL_PORT=5432
|
SQL_PORT=5432
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ app.config.from_object("project.config.Config")
|
|||||||
db = SQLAlchemy(app)
|
db = SQLAlchemy(app)
|
||||||
#jwt_secret = os.getenv("JWT_SECRET")
|
#jwt_secret = os.getenv("JWT_SECRET")
|
||||||
app.config['SECRET_KEY'] = os.getenv("JWT_SECRET")
|
app.config['SECRET_KEY'] = os.getenv("JWT_SECRET")
|
||||||
|
panel_url = os.getenv("PANEL_URL")
|
||||||
|
|
||||||
mail = Mail(app) # instantiate the mail class
|
mail = Mail(app) # instantiate the mail class
|
||||||
|
|
||||||
@@ -103,6 +104,12 @@ engine = create_engine(dataUrl)
|
|||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def hello_world():
|
def hello_world():
|
||||||
|
# mail.send(
|
||||||
|
# subject="Template example",
|
||||||
|
# receivers=["ameye@chiefsoft.com"],
|
||||||
|
# html_template="email/verify.html"
|
||||||
|
# )
|
||||||
|
|
||||||
send_register_mail('ameye@chiefsoft.com')
|
send_register_mail('ameye@chiefsoft.com')
|
||||||
# msg = Message(
|
# msg = Message(
|
||||||
# 'Hello',
|
# 'Hello',
|
||||||
@@ -260,21 +267,35 @@ def start_register():
|
|||||||
}, 500
|
}, 500
|
||||||
|
|
||||||
def send_register_mail(signup_email):
|
def send_register_mail(signup_email):
|
||||||
msg = Message(
|
#panel_url
|
||||||
|
signup_data = {}
|
||||||
|
signup_data["id"] = '100'
|
||||||
|
signup_data["uid"] = 'a4b75649-e3c5-424f-bcdb-5481e625d24b'
|
||||||
|
|
||||||
|
jwt_part = jwt.encode(
|
||||||
|
{"user": signup_data, 'exp' : datetime.datetime.utcnow() + datetime.timedelta(minutes=3330)},
|
||||||
|
app.config["SECRET_KEY"],
|
||||||
|
algorithm="HS256"
|
||||||
|
)
|
||||||
|
link_url= str(panel_url) + '/csignup/' + jwt_part
|
||||||
|
print(link_url)
|
||||||
|
msg = Message(
|
||||||
'verify your MERMS Account',
|
'verify your MERMS Account',
|
||||||
sender ='message@chiefsoft.com',
|
sender ='message@chiefsoft.com',
|
||||||
recipients = [signup_email,'ameye+merscopy@chiefsoft.com']
|
recipients = [signup_email,'ameye+merscopy@chiefsoft.com']
|
||||||
)
|
)
|
||||||
msg.body = """Hello Firstname,
|
msg.body = """Hello Firstname,
|
||||||
You recived this message for account verification
|
You received this message for account verification
|
||||||
|
|
||||||
Follow the link: https://works.mermsemr.com/csignup/JWT-djhgdhjgdhdggggd
|
Follow the link:" {% link_url %}
|
||||||
|
|
||||||
|
https://dev-panel.mermsemr.com/csignup/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiOTgyODkyODQyODI4NTI4OSIsInVpZCI6Ijk4Mjg5Mjg0MjgyODUyODkifSwiZXhwIjoxNzM1NTA0MDE4fQ.pDQvYUr_PGZMeMO2gr-B3DRQ7AM7IjVM5vSERNTviG4
|
||||||
|
|
||||||
For any Support
|
For any Support
|
||||||
Reach Out
|
Reach Out
|
||||||
"""
|
"""
|
||||||
|
|
||||||
mail.send(msg)
|
mail.send(msg)
|
||||||
|
|
||||||
@app.route("/panel/auth/reset", methods=["POST"])
|
@app.route("/panel/auth/reset", methods=["POST"])
|
||||||
def start_resetpass():
|
def start_resetpass():
|
||||||
|
|||||||
Reference in New Issue
Block a user