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

Email notification #433

Merged
merged 33 commits into from
Mar 16, 2020
Merged

Email notification #433

merged 33 commits into from
Mar 16, 2020

Conversation

Stezido
Copy link
Contributor

@Stezido Stezido commented Feb 12, 2020

Description

  • Trubudget should offer a possibility to send email notifications.
  • The email notification shall only contain the link to the notifications page since the rest of the information can be seen there. It is not important that the notification contains more detailed information.
  • A User shall be able to subscribe or unsubscribe to email notifications via Trubudget.
  • It shall not be possible to select certain email notifications that are sent to a user.

Solution

As shown in the architecture section below, a script shall filter every transaction. The script saves the transactions with a timestamp locally as files in a notification folder.
An external process watches the notification folder and sends the user's ids via http request to the email service.
The email service creates one http server which handle:

  1. GetEmail of user
  2. Sending notifications to external smtp server
  3. un-/subscribing with email via frontend

Via env variables the email service can connect to the external SMTP-Server which actually sends the emails.
The frontend handles a user's email address in a user profile, available when clicking on the profile picture.

Architecture

image

Todo

Email-Service

Hook/ filterScript

  • Save filtered transactions with timestamp as files in local folder
  • Spawn an external process which handle reading of notification files, sending of ids to email service and deleting of files succesfully sent.
  • Delete notification files which cannot be sent for a longer time (default 24 hours)
  • Check error messages: do not throw error if create stream transaction is checked
  • Rewrite send Notification process in javascript

Frontend

  • Create e2e-tests
  • User-Profile should be own container since there are to many props in navbar container
  • Clicking on User image to open user profile is not obvious - create settings icon for it

Documentation

Closes #419
Closes #65

@Stezido Stezido self-assigned this Feb 12, 2020
@openkfwCI
Copy link

openkfwCI commented Feb 12, 2020

Warnings
⚠️ It looks like an ID was added. Please make sure it is not a secret.

Generated by 🚫 dangerJS against 99b4abe

@openkfwCI
Copy link

openkfwCI commented Feb 12, 2020

NotesTime
Note for Reviewer: E2E tests on remote server succeededMon, 16 Mar 2020 13:04:31 +0000

Generated by E2E-Test

Copy link
Contributor

@mathiashoeld mathiashoeld left a comment

Choose a reason for hiding this comment

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

important: please change all occurrences of "email" to "email address" where appropriate

@Stezido Stezido force-pushed the email-notification branch from 4cbef60 to 586a683 Compare March 11, 2020 17:39
@mathiashoeld mathiashoeld force-pushed the email-notification branch 4 times, most recently from 5b3424f to 56dd935 Compare March 16, 2020 11:33
Stezido added 18 commits March 16, 2020 12:38
The email-service starts two servers when executed
Server started:
	- TCP Server (TCP Command Listener)
            All relevant hooks should be handled (currently only sendNotifications)
	- HTTP Server (express)
            All requests which modify the email database are handled
On walletnotifynew, a mutlichain runtimeparamter, a script called 'filterScript' (written in go) is executed
This script checks each transaction if it's a notification_created event.
If so a notification is send via tcp to the email-service.
To configure te email-service connection following env vars are used:
    - EMAIL_HOST
    - EMAIL_PORT
Only show email if service available
Implement un-/subscribe to the email notification
Create directory "notifications" if not exist (done by sendData as well as filterScript)
Clean up windows binary files
Prepared docker-compose file including email service and email database
Rename filterScript to multichain-feed
Structure go code to be able to easily exand the multichain-feed with other hooks/sideEffects
Restructure filesystem
improve logging
@mathiashoeld mathiashoeld merged commit c984bc6 into master Mar 16, 2020
@mathiashoeld mathiashoeld deleted the email-notification branch March 16, 2020 13:27
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.

Email notification implementation email notifications
3 participants