Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broke in prod :( added logging #77

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading