config emsil param
This commit is contained in:
@@ -24,6 +24,9 @@ from app.config import Config
|
||||
class RegisterService(BaseService):
|
||||
JWT_SECRET_KEY = Config.JWT_SECRET_KEY
|
||||
|
||||
SEND_EMAIL_FROM = Config.SEND_EMAIL_FROM
|
||||
SEND_EMAIL_PASS = Config.SEND_EMAIL_PASS
|
||||
|
||||
@staticmethod
|
||||
def process_verify(data):
|
||||
#"verify_link": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiMThmYzg0YTQtYjQzMC00ZWFkLWE4ZjEtMTk2MTJmNzA5ZDE0IiwiZXhwIjoxNzUyMjc2NjQzfQ.UEsSpCkMq8xNTLiqzyCB572tK-9WkeYaSBF4gfvX7vk"
|
||||
@@ -65,7 +68,7 @@ class RegisterService(BaseService):
|
||||
# "country": country,
|
||||
# }
|
||||
response_data = {
|
||||
"member_id": data,
|
||||
"user": data.user,
|
||||
"country": country,
|
||||
}
|
||||
|
||||
@@ -100,17 +103,11 @@ class RegisterService(BaseService):
|
||||
email = validated_data.get('email')
|
||||
|
||||
regData = MembersPending.add_members_pending( firstname, lastname, email)
|
||||
# {
|
||||
# "email": "ameye@chiefsoft.com",
|
||||
# "firstname": "Olusesan",
|
||||
# "lastname": "Ameye",
|
||||
# "isChecked": true
|
||||
# }
|
||||
send_register_mail(regData.email, regData.uid, regData.id, firstname)
|
||||
send_register_mail(regData.email, regData.uid, regData.id, firstname, lastname)
|
||||
|
||||
response_data = {
|
||||
"member_id": 0,
|
||||
"uid": 0,
|
||||
"pending_id": regData.id,
|
||||
"pending_uid": regData.uid,
|
||||
}
|
||||
|
||||
return ResponseHelper.success(data=response_data)
|
||||
@@ -131,42 +128,15 @@ class RegisterService(BaseService):
|
||||
db.session.rollback()
|
||||
return ResponseHelper.internal_server_error()
|
||||
|
||||
# @staticmethod
|
||||
# def check_loan_limits(customer_id):
|
||||
# """
|
||||
# Checks if a customer has exceeded the loan limits for given offer.
|
||||
# """
|
||||
# loan = Loan.get_customer_last_loan(customer_id)
|
||||
#
|
||||
# if not loan:
|
||||
# return True
|
||||
#
|
||||
# offer_id = loan.offer_id[:5]
|
||||
#
|
||||
# offer = Offer.get_offer_by_id(offer_id)
|
||||
# if not offer:
|
||||
# logger.error(f"Offer not found for offer_id: {offer_id} (customer_id: {customer_id})")
|
||||
# return False
|
||||
#
|
||||
# daily_count = Loan.get_daily_loan_count(customer_id, offer.product_id)
|
||||
#
|
||||
# logger.info(f"daily_count: {daily_count}, Max: {offer.max_daily_loans}")
|
||||
#
|
||||
# if offer.max_daily_loans is not None and daily_count >= offer.max_daily_loans:
|
||||
# return False
|
||||
#
|
||||
# return True
|
||||
|
||||
|
||||
|
||||
def send_register_mail(signup_email, email_uid,last_row_id,firstname):
|
||||
def send_register_mail(signup_email, pending_uid,pending_id,firstname, lastname):
|
||||
|
||||
pending_member = {
|
||||
"email": signup_email,
|
||||
"uid": email_uid,
|
||||
"pending_uid": pending_uid,
|
||||
"first_name": firstname,
|
||||
"last_name": signup_email,
|
||||
"member_id":last_row_id,
|
||||
"last_name": lastname,
|
||||
"pending_id":pending_id,
|
||||
}
|
||||
jwt_part = jwt.encode(
|
||||
{"user": pending_member, 'exp' : datetime.datetime.utcnow() + datetime.timedelta(minutes=3330)},
|
||||
@@ -187,10 +157,10 @@ def send_register_mail(signup_email, email_uid,last_row_id,firstname):
|
||||
support@mermsemr.com
|
||||
"""
|
||||
|
||||
sender_email = "support@wrenchboard.com"
|
||||
sender_password = 'May12002!xF7F220A97f' # Use an app-specific password if using Gmail
|
||||
sender_email = RegisterService.SEND_EMAIL_FROM
|
||||
sender_password = RegisterService.SEND_EMAIL_PASS
|
||||
receiver_email = signup_email
|
||||
subject = "verify your MERMS Account"
|
||||
subject = "Verify your MERMS(AI) Account Setup"
|
||||
body = msg_body
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ class Config:
|
||||
BASIC_AUTH_USERNAME = os.environ.get("BASIC_AUTH_USERNAME", "user")
|
||||
BASIC_AUTH_PASSWORD = os.environ.get("BASIC_AUTH_PASSWORD", "password")
|
||||
|
||||
#Email Server
|
||||
SEND_EMAIL_FROM = os.environ.get("SEND_EMAIL_FROM","message@chiefsoft.com")
|
||||
SEND_EMAIL_PASS = os.environ.get("SEND_EMAIL_PASS","may12002!")
|
||||
|
||||
# Database Configuration
|
||||
DATABASE_USER = os.environ.get("DATABASE_USER","merms_panel")
|
||||
|
||||
Reference in New Issue
Block a user