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

Python3 Update and Notification Email #6

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

Conversation

softpoint-consultores
Copy link

@softpoint-consultores softpoint-consultores commented Jul 2, 2020

Hi,

With this pull request, you can use Python3 instead of Python2.
The system is tested on BigBlueButton 2.2.19
Also now it uses the standard logging system (import logging).

Finally we added the option to send notification emails (configurable to the users), so they can receive the link whenever it is ready.

@alexanderlhk
Copy link

@fernaper What are some example placeholder values for the following variables?

MAINTAINER = ''
API_GET_RECEIVERS = ''
API_USER = ''

@fernaper
Copy link

Hi @alexanderlhk
Thank you for being interested.

MAINTAINER is an email, for example "[email protected]". It is usefull to capture exceptions and fix possible bugs.
API_GET_RECEIVERS is an entrypoint to our custom API, we need it to know the email to send the recording.
API_USER and API_PASS are the Basic Authentication credentials to connect our API_GET_RECEIVERS entrypoint.

To integrate that part, it will be necessary to change code from download.py from line 372 with the next code (or something similar):

        if config.SEND_EMAIL:
            try:
                url = 'https://{dns}/download/presentation/{meetingId}/{meetingId}.mp4 '.format(
                    dns=config.DNS,
                    meetingId=meetingId
                )

                language_to_users = {
                    config.LANGUAGE: config.ALERT_RECEIVERS
                }

                for language, users in language_to_users.items():
                    mail_header = get_mail_header(config.COMPANY, language=language)
                    mail_body = get_mail_body(url, language=language)

                    sendmail(mail_header, html_email('', mail_body), receivers=users)
            except Exception as e:
                mail_body = 'Exception: {}'.format(e)

                sendmail('[RECORDING EXCEPTION] {}'.format(config.COMPANY),
                            html_email('', mail_body),
                            receivers=[config.MAINTAINER]
                )

        if logger.level > logging.DEBUG:
            time.sleep(5)
            logger.info('Cleaning up temp files...')
            cleanup()
            logger.info('Done')


if __name__ == '__main__':
    main()

@alexanderlhk
Copy link

alexanderlhk commented Oct 13, 2020

I see, I would like to try it out and see what can be done to improve it as well.

So what do we pass in "API_GET_RECEIVERS"? @fernaper

Or are we leaving that blank so that the function can store the response?

Edit: I understood what it does. still trying to. configure it...

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.

3 participants