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

Mail user on TransactionStop and SuspendedEV event #1263

Open
wants to merge 50 commits into
base: master
Choose a base branch
from

Conversation

fnkbsi
Copy link
Contributor

@fnkbsi fnkbsi commented Oct 12, 2023

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.

Tester and others added 18 commits August 2, 2023 19:19
…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
@Zeppel
Copy link

Zeppel commented Dec 22, 2023

Steve tries infinitely to send mails for every tag without a user. After some time the server becomes unstable.

@fnkbsi
Copy link
Contributor Author

fnkbsi commented Dec 22, 2023

@Zeppel: Thanks for the feedback.
I try to reproduce the behavior. It would help if you can answer some the following questions.
On which event starts SteVe to try sending mails?
Which notification are selected on the setting-website? Is the List of recipients empty?
Are the OCPP-Tags without user blocked or active? (Does SteVe try to send to both?)
Is the transaction started with an OCPP-Tag without a user?
Can you provide a log file?

@Zeppel
Copy link

Zeppel commented Dec 25, 2023

@fnkbsi
Event: occures at SuspendedEV event

Selected Notifies:
image

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.
steve.log

occurred location:
src/main/java/de/rwth/idsg/steve/repository/UserRepository.java
User.Details getDetails

Expected behavior:
return and do nothing

@fnkbsi
Copy link
Contributor Author

fnkbsi commented Dec 26, 2023

@Zeppel: My hypothesis is, the exception blocks sending the response to transactionStop, so the charge box resend the transactionStop message and that leads to a loop. By catching the exception and calling the notification asynchronously it should now work. Thanks again for the feedback!

@juherr
Copy link
Contributor

juherr commented Jun 19, 2024

@goekay Please review, this PR is improving the product

@goekay
Copy link
Member

goekay commented Jun 23, 2024

what if the user does not want to receive emails?

@fnkbsi
Copy link
Contributor Author

fnkbsi commented Jun 23, 2024

what if the user does not want to receive emails?

Currently the mail-address must removed. I admit this works not with all business cases. Better solution would be to save the user decision in the DB. I can add a column to the user table or adding a new table (user_pk, send_mail), which should it be?

update: with this commit the solution with a new column is added

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.

4 participants