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

[FEAT] disable email delivery #1419

Merged
merged 7 commits into from Apr 18, 2024
Merged

Conversation

FreddyDevelop
Copy link
Contributor

@FreddyDevelop FreddyDevelop commented Apr 4, 2024

Description

Add a config option to disable email delivery by hanko. Currently there is no way to style the emails hanko is sending. With this option a user can send and style the emails themself.
If email delivery is disabled you do not need to provide smtp settings. To send an email yourself you need to add a webhook which is subscribed to the email.create event.

Implementation

A new webhook event is introduced (email.create). This will always be triggered when an email was sent or when it should be sent, depending if email delivery is enabled or disabled. This webhook event contains all data that is necessary to send your own email (e.g. subject, body, passcode, ttl, toAddress). This webhook event also contains a flag which indicates if the email was sent by hanko or not.

Tests

To test this create a new webhook with the email.create event. Then enable the email delivery (it is by default) and check if the email is still sent and that the webhook gets called and the delivered_by_hanko flag is set to true. Then disable the email delivery and check that the email is not sent that the webhook gets called and that the delivered_by_hanko flag is set to false.

Co-authored-by: Lennart Fleischmann <67686424+lfleischmann@users.noreply.github.com>
@FreddyDevelop FreddyDevelop merged commit def7ad3 into main Apr 18, 2024
12 checks passed
@FreddyDevelop FreddyDevelop deleted the feat-disbale-email-delivery branch April 18, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants