Gregniuki commited on
Commit
4e57d31
1 Parent(s): 8e5c6a9

Update emailx.py

Browse files
Files changed (1) hide show
  1. emailx.py +5 -5
emailx.py CHANGED
@@ -9,7 +9,7 @@ MAILJET_API_KEY = os.environ['MAILJET_API_KEY']
9
  MAILJET_API_SECRET = os.environ['MAILJET_API_SECRET']
10
 
11
  # Create a Mailjet client
12
- mailjet = Client(auth=(MAILJET_API_KEY, MAILJET_API_SECRET))
13
 
14
  def send_verification_email(to_email, verification_token):
15
  # Create the email message
@@ -36,13 +36,13 @@ def send_verification_email(to_email, verification_token):
36
  try:
37
  response = mailjet.send.create(data=email_data)
38
  if response.status_code == 200:
39
- print response.status_code
40
- print response.json()
41
  print("Verification email sent successfully.")
42
  else:
43
  print("Failed to send verification email.")
44
- print response.status_code
45
- print response.json()
46
  except Exception as e:
47
  print(str(e))
48
 
 
9
  MAILJET_API_SECRET = os.environ['MAILJET_API_SECRET']
10
 
11
  # Create a Mailjet client
12
+ mailjet = Client(auth=(MAILJET_API_KEY, MAILJET_API_SECRET), version='v3.1')
13
 
14
  def send_verification_email(to_email, verification_token):
15
  # Create the email message
 
36
  try:
37
  response = mailjet.send.create(data=email_data)
38
  if response.status_code == 200:
39
+ print(response.status_code)
40
+ print(response.json())
41
  print("Verification email sent successfully.")
42
  else:
43
  print("Failed to send verification email.")
44
+ print(response.status_code)
45
+ print(response.json())
46
  except Exception as e:
47
  print(str(e))
48