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

E-Mail notifications once an upload is complete #672

Closed
LukasKalbertodt opened this issue Jan 19, 2023 · 7 comments
Closed

E-Mail notifications once an upload is complete #672

LukasKalbertodt opened this issue Jan 19, 2023 · 7 comments
Assignees
Labels
area:auth Authentication and Authorization area:opencast The Opencast side kind:new-feature A new feature needs:decision Needs a decision of some kind (discussion thread) needs:external-input We need some input from admins, users, ... status:blocked Blocked by something else

Comments

@LukasKalbertodt
Copy link
Member

LukasKalbertodt commented Jan 19, 2023

This is a feature requested by the ETH. It is unclear which part of the whole software stack should be responsible for this. I think Opencast should do E-Mail notifications. Tobira does currently not have an email for users and has also no capabilities to send mails. That would add quite a bit of complexity to it all.

However, we are not done with it by saying "ok Opencast should do it". How does Opencast get the user E-Mail? The upload is done via a temporary JWT user. Opencast could look up a mail address for a specific username, but uff. Or Tobira does need to know about E-Mails? And what if we want a checkbox in Tobira for users to select whether they want e-mail notifications? Lots of open questions.

@LukasKalbertodt LukasKalbertodt added kind:new-feature A new feature needs:research Needs research as we are lacking knowledge to make an informed decision area:opencast The Opencast side area:auth Authentication and Authorization labels Jan 19, 2023
@oas777
Copy link
Collaborator

oas777 commented Jun 14, 2023

Alternatively, an information should be provided in Tobira.

@JulianKniephoff
Copy link
Member

JulianKniephoff commented Oct 28, 2024

So I looked into this and could get my local Opencast + Tobira setup to send myself an email at the end of a workflow, targeting the email address of my Tobira user, (ab-)using the elan mail server.

So yes, this is already possible, with just Opencast configuration.

The way I was doing it relied upon the username Tobira tells Opencast being unique, as it is used to look up the email address internally. If we don't want that, there are a few rather easy changes one could apply to Opencast and/or Tobira to remove that requirement. Before we investigate further into those, we should talk about it, though. /cc @dagraf, @oas777.

What follows is a rather technical description of the process for the purposes of documentation.


First of all, Opencast needs to be able to send email. Everything one needs to know is in the file etc/org.opencastproject.kernel.mail.SmtpService.cfg. But yeah, that means you need access to some SMTP server somewhere.

With that, it's as simple as adding a workflow operation to whatever workflow the uploader triggers, probably somewhere near the end. The docs for the appropriate workflow operation handler are surprisingly thorough, and FWIW here is my very basic test:

    <operation id="send-email">
      <configurations>
        <configuration key="to">${workflow.creatorName}</configuration>
        <configuration key="subject">${mediaPackage.title} has been published</configuration>
      </configurations>
    </operation>

The one thing I didn't get from the docs but from reading the code is the fact that addresses (to, cc, etc.) are "parsed." That is, the code splits them at ,, checks whether they are valid email addresses, and if they are not, interprets them as usernames and tries to look up any address Opencast might have stored for any user with that name.

@JulianKniephoff JulianKniephoff added needs:decision Needs a decision of some kind (discussion thread) needs:external-input We need some input from admins, users, ... status:blocked Blocked by something else and removed needs:research Needs research as we are lacking knowledge to make an informed decision labels Oct 28, 2024
@JulianKniephoff JulianKniephoff moved this to Blocked 🛑 in Tobira Oct 28, 2024
@LukasKalbertodt
Copy link
Member Author

FWIW, Tobira already requires auth solutions to provide unique usernames: https://elan-ev.github.io/tobira/setup/auth/user#user-information-tobira-needs

Though the docs are a bit underspecified... it might be unique in Tobira, but when Opencast uses other sources of usernames as well, things could clash.

@oas777
Copy link
Collaborator

oas777 commented Oct 28, 2024

Thanks, Julian. Don't forget to adapt the feedback text the user sees:

"Ihr Video wurde erfolgreich hochgeladen und wird nun verarbeitet; Sie erhalten eine Benachrichtigung per E-Mail, sobald das Video zur Verfügung steht. Sie können diese Seite jetzt schließen."
"Your video was uploaded successfully and is now being processed; you will receive an e-mail once processing is done and the video is available. You may close this page now."

@JulianKniephoff
Copy link
Member

That's a good point, but one we should talk about as well: Tobira can't know and/or rely on the fact that the connected Opencast will actually send a mail in the relevant workflow, right now. 🤔

@oas777
Copy link
Collaborator

oas777 commented Nov 20, 2024

Reminder to close this.

@LukasKalbertodt
Copy link
Member Author

So yes, the ETH successfully configured their workflows to send email notifications. This is helped by #1268.

The text might still be changed in the future, but that's not the highest priority and we are waiting for other changes (like #556 and #444).

@github-project-automation github-project-automation bot moved this from Blocked 🛑 to Done ✔️ in Tobira Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:auth Authentication and Authorization area:opencast The Opencast side kind:new-feature A new feature needs:decision Needs a decision of some kind (discussion thread) needs:external-input We need some input from admins, users, ... status:blocked Blocked by something else
Projects
Status: Done ✔️
Development

No branches or pull requests

3 participants