mirror of
https://github.com/hrfee/jellyfin-accounts.git
synced 2025-12-13 22:11:12 +00:00
added option to send invite to an address
The admin page now has the option to send an invite to an email address. Since there are now two email types (invites and pw resets), the new sections have been added to config.ini, and email_template and email_plaintext have been renamed to email_html and email_text respectively.
This commit is contained in:
28
jf-accounts
28
jf-accounts
@@ -87,12 +87,26 @@ for key in config['files']:
|
||||
log.debug(f'Using default {key}')
|
||||
config['files'][key] = str(data_dir / (key + '.json'))
|
||||
|
||||
if config['email']['email_template'] == '':
|
||||
log.debug('Using default email HTML template')
|
||||
config['email']['email_template'] = str(local_dir / 'email.html')
|
||||
if config['email']['email_plaintext'] == '':
|
||||
log.debug('Using default email plaintext template')
|
||||
config['email']['email_plaintext'] = str(local_dir / 'email.txt')
|
||||
if ('email_html' not in config['password_resets'] or
|
||||
config['password_resets']['email_html'] == ''):
|
||||
log.debug('Using default password reset email HTML template')
|
||||
config['password_resets']['email_html'] = str(local_dir / 'email.html')
|
||||
if ('email_text' not in config['password_resets'] or
|
||||
config['password_resets']['email_text'] == ''):
|
||||
log.debug('Using default password reset email plaintext template')
|
||||
config['password_resets']['email_text'] = str(local_dir / 'email.txt')
|
||||
|
||||
if ('email_html' not in config['invite_emails'] or
|
||||
config['invite_emails']['email_html'] == ''):
|
||||
log.debug('Using default invite email HTML template')
|
||||
config['invite_emails']['email_html'] = str(local_dir /
|
||||
'invite-email.html')
|
||||
if ('email_text' not in config['invite_emails'] or
|
||||
config['invite_emails']['email_text'] == ''):
|
||||
log.debug('Using default invite email plaintext template')
|
||||
config['invite_emails']['email_text'] = str(local_dir /
|
||||
'invite-email.txt')
|
||||
|
||||
|
||||
if args.get_policy:
|
||||
import json
|
||||
@@ -136,7 +150,7 @@ else:
|
||||
host = config['ui']['host']
|
||||
port = config['ui']['port']
|
||||
log.info(f'Starting web UI on {host}:{port}')
|
||||
if config.getboolean('email', 'enabled'):
|
||||
if config.getboolean('password_resets', 'enabled'):
|
||||
def start_pwr():
|
||||
import jellyfin_accounts.pw_reset
|
||||
jellyfin_accounts.pw_reset.start()
|
||||
|
||||
Reference in New Issue
Block a user