An authentication trigger automatically invokes server-side logic when a user creates an account, logs in, or deletes an account. It connects authentication activity with application workflows such as messaging and subscriptions. section 19.2.1 section 19.3
Use authentication triggers to respond automatically to:
- New account registration, such as sending a welcome email. section 19.3
- User login events and account deletion events. section 19.2.1
- Registration workflows that automatically subscribe users to a mailing list. section 19.3
Welcome email after registration
Configure an authentication trigger for account creation and associate it with an Atlas Function that sends a welcome email. The trigger starts the function automatically when registration occurs. section 19.3
Figure 19.4 Trigger types in Atlas: database (insert, update, delete, and replace), scheduled (basic and advanced), and authentication (create, login, and delete) (Image © MongoDB 2024 CC BY-NC-SA 3.0)
Use the trigger-type overview to distinguish authentication events from database operations and scheduled executions. section 19.2.1
