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

Add Slack Notifications for New User Registrations #413

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sundayonah
Copy link
Collaborator

@sundayonah sundayonah commented Feb 3, 2025

Description

Implements Slack notifications for new user signups, notifying administrators when a user registers. This feature includes user details such as user ID, email, first name, last name, role (provider or sender), and provider-specific details (e.g., currency for providers). The notifications will be sent only in the production environment, and errors in sending the notifications will be logged without interrupting the registration process.

References

n/a

Testing

User signup and Slack notification service integration
Role-specific notifications (provider/sender)
Slack webhook error handling and logging
Environment-specific notification dispatch (production only)

Checklist

  • Implemented Slack notification service for user signups
  • Modified Register function in AuthController to call Slack notification after successful user creation
  • Included user details in the Slack notification
  • Ensured notifications are only sent in the production environment
  • Added error logging for Slack notification failures

closes #410

@sundayonah sundayonah changed the title [WIP] Add Slack Notifications for New User Registrations Add Slack Notifications for New User Registrations Feb 3, 2025
@sundayonah sundayonah marked this pull request as draft February 3, 2025 14:15
// Only send in production

conf := config.ServerConfig()
if conf.Environment != "production" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only make this check in one place i think, so either removing it from here should be better to allow control from where it been called

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, thanks! I've actually removed the check from the function and now only perform it in Register

@sundayonah sundayonah marked this pull request as ready for review February 3, 2025 18:43
return nil
}

func contains(slice []string, str string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sundayonah this should be moved to utils.go

Copy link
Contributor

@5ran6 5ran6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far. Wanted to know if you actually tested this Slack WEBHOOK with live credentials say via Postman and it worked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send Slack notification for new user signups
3 participants