-
-
Notifications
You must be signed in to change notification settings - Fork 438
Mail user on TransactionStop and SuspendedEV event #1263
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
base: master
Are you sure you want to change the base?
Conversation
…nd(String subject, String body, String RecipientAddresses)" use addresses from setting if RecipientAddresses is empty; adding method "sendAsync(String subject, String body, String RecipientAddresses)"
…nded notification)" adding send mail to user (if email address is in the database), adding createContent method for user mail
…ublishing a event if the status is "SuspendedEV"
…tionStatusSuspendedEV notification) to send a mail to the user
…EV, rearange the if clauses
Steve tries infinitely to send mails for every tag without a user. After some time the server becomes unstable. |
@Zeppel: Thanks for the feedback. |
…r by transactionPk desc, to avoid fetching ghost transactions
…n case of no user is found by the OcppTag
@fnkbsi 1 entry in recipients OCPP-Tag is active and started the transcation without an user. Log attached - Exception occures 10x per second until a user is found, no mails will be send. If a user is selected for the tag afterwards, mails are send to the user and recipient email. Errors stop then. occurred location: Expected behavior: |
# ressolved Conflicts: # src/main/java/de/rwth/idsg/steve/service/MailService.java -> implementation moved to MailServiceDefault
…ecipientAddresses) from interface
# resolved Conflicts: # src/main/resources/checkstyle.xml
hey @fnkbsi, i want to proceed with this PR and here is my feedback:
thanks! |
…onStatusFailure and SuspendedEV event. adapt QueryForm and TransactionRepository
|
78beb12
to
58d2733
Compare
# Conflicts: # src/main/java/de/rwth/idsg/steve/repository/dto/User.java # src/main/java/de/rwth/idsg/steve/repository/impl/UserRepositoryImpl.java # src/main/java/de/rwth/idsg/steve/service/MailService.java # src/main/java/de/rwth/idsg/steve/service/MailServiceDefault.java # src/main/java/de/rwth/idsg/steve/service/NotificationService.java # src/main/java/de/rwth/idsg/steve/utils/mapper/UserFormMapper.java # src/main/java/de/rwth/idsg/steve/web/controller/UsersController.java
58d2733
to
09668c0
Compare
8e7612c
to
1170e4b
Compare
* separate user notifications from others: introduction of NotificationServiceForUser * simplify and dedup user notification logic in NotificationServiceForUser * refactor MailService: async not needed for mail for user notifications, because the whole user notification processing is done in async * UserRepository.getDetails(String ocppTag) is not needed. the use cases can be achieved via getOverview(..)
1170e4b
to
9828d8b
Compare
.. by adding a boolean flag to express that this feature is also for user
|
||
// if the TransactionStop is received within the first Minute don't send an E-Mail | ||
if (!transaction.getStopTimestamp().isAfter(transaction.getStartTimestamp().plusMinutes(1))) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @fnkbsi can you tell why you felt the need to add this time check?
|
||
// No mail directly after the start of the transaction, | ||
if (!event.getTimestamp().isAfter(transaction.getStartTimestamp().plusMinutes(1))) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @fnkbsi can you tell why you felt the need to add this time check?
cannot understant their use case. maybe to prevent user flood? but then, the user would be thinking false-positively that the transaction is going on without issues even though it was stopped. it was stopped and we did not let the user know.
whoever is (still) interested: i think the current state of the PR is production-ready and can be merged. pls take a final look. i aim to merge in a couple of days. thank you @fnkbsi ! |
Send a email to the transaction user in case of SuspendedEV and Transaction Stop, if the email address of the user is stored in the database.