Skip to content

Commit

Permalink
complete functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoromike authored and jimmykamau committed Feb 27, 2019
1 parent 9c2ac7a commit 832b935
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
23 changes: 11 additions & 12 deletions src/api/endpoints/redemption_requests/redemption_numeration.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ def put(self, redeem_id=None):
recipients=[finance_email]
)

# self.email.send(
# current_app._get_current_object(),
# payload=email_payload,
# mail=self.mail
# )
self.email.send(
current_app._get_current_object(),
payload=email_payload,
mail=self.mail
)

email_payload = dict(
sender=current_app.config["SENDER_CREDS"],
Expand All @@ -110,19 +110,18 @@ def put(self, redeem_id=None):

# Send Slack notification to Society President
message = f"Redemption Request on" + \
f" *{redemp_request.name}*" + \
f" *{redemp_request.name}* worth *{redemp_request.value}* points" + \
f" has been approved." + \
f" Finance will be in touch"
user_email = redemp_request.user.email
print(user.email)
slack_id = SlackNotification.get_slack_id(self, user_email)
SlackNotification.send_message(self, message, slack_id)

# self.email.send(
# current_app._get_current_object(),
# payload=email_payload,
# mail=self.mail
# )
self.email.send(
current_app._get_current_object(),
payload=email_payload,
mail=self.mail
)
elif status == "rejected":
redemp_request.status = status
redemp_request.rejection = rejection_reason
Expand Down
10 changes: 5 additions & 5 deletions src/api/endpoints/redemption_requests/redemption_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ def post(self):
recipients=[user.email for user in CIO.users]
)

# self.email.send(
# current_app._get_current_object(),
# payload=email_payload,
# mail=self.mail
# )
self.email.send(
current_app._get_current_object(),
payload=email_payload,
mail=self.mail
)

return response_builder(dict(
message="Redemption request created. Success Ops will be in"
Expand Down

0 comments on commit 832b935

Please sign in to comment.