Skip to content

Commit

Permalink
Merge pull request #77 from opportunity-hack/develop
Browse files Browse the repository at this point in the history
Broke in prod :( added logging
  • Loading branch information
gregv authored Aug 11, 2024
2 parents ffc4eb3 + 194aeac commit 914949b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion api/messages/messages_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,12 @@ def save_npo_application(json):

logger.info(f"Insert Result: {insert_res}")

logger.info(f"Sending welcome email to {name} {email}")

send_nonprofit_welcome_email(name, email)

logger.info(f"Sending slack message to nonprofit-form-submissions")

# Send a Slack message to nonprofit-form-submissions with all content
slack_message = f'''
:rocket: New NPO Application :rocket:
Expand All @@ -636,7 +640,9 @@ def save_npo_application(json):
Idea: `{idea}`
Is Nonprofit: `{isNonProfit}`
'''
send_slack(slack_message, "nonprofit-form-submissions")
send_slack(channel="nonprofit-form-submissions", message=slack_message, icon=":rocket:")

logger.info(f"Sent slack message to nonprofit-form-submissions")



Expand Down Expand Up @@ -1053,9 +1059,12 @@ def send_nonprofit_welcome_email(organization_name, contact_name, email):
"subject": subject,
"html": html_content,
}
logger.info(f"Sending nonprofit application email to {email}")

email = resend.Emails.SendParams(params)
resend.Emails.send(email)

logger.info(f"Sent nonprofit application email to {email}")
return True

def send_welcome_email(name, email):
Expand Down

0 comments on commit 914949b

Please sign in to comment.