Commit Graph

62 Commits

Author SHA1 Message Date
Harvey Tindall 77799b2917
smtp: only construct email once
also switch layout in email file to group each driver and its methods
together.
2021-10-07 16:19:06 +01:00
Harvey Tindall d560df5b1e
switch smtp library, add, HELLO hostname option
now using xhit/go-simple-mail, as I wanted to add an option to change
the hostname sent in the HELLO message but this is only possible with
STARTTLS in jordan-wright/email. New option can be seen in Settings >
SMTP with advanced settings turned on.
2021-10-07 12:01:42 +01:00
Harvey Tindall 548dceda28
don't give smtp plainauth if no username & password
for #141, just a guess
2021-08-26 21:03:02 +01:00
Harvey Tindall e67b2e91fb
invite: auto-append /invite if missing to url_base 2021-08-26 18:53:22 +01:00
Harvey Tindall 9693ce3dcd
settings: add redundant URL base for pwr
having it under "Invite Emails" when they weren't in use was confusing.
If only one is set in the config file, it'll be used for both.
2021-07-27 16:53:16 +01:00
Harvey Tindall 9885c25a2e
email: cleanup; allow re-enabling of custom email without changes 2021-07-24 19:49:08 +01:00
Harvey Tindall f763cfb53a
announcements: fix [] on {{ .username }} 2021-07-16 20:57:11 +01:00
Harvey Tindall 25a8d3807e
announcements: {{ .username }} 2021-07-16 19:46:05 +01:00
Harvey Tindall b10b558358
announcements: add {username}
also works in the subject.
2021-07-16 19:39:06 +01:00
Harvey Tindall 833d02b032
matrix: end-to-end encryption by default
Existing chats will remain unencrypted but new ones will be.
2021-07-13 19:02:16 +01:00
Harvey Tindall d4096d0062
pwr: trim suffix, not prefix for links 2021-06-24 14:24:08 +01:00
Harvey Tindall 6fb8f1ed7f
Merge pull request #112 from hrfee/matrix
Matrix Integration
2021-05-31 21:12:57 +01:00
Harvey Tindall 561c461a18
PWR: TrimPrefix instead of Replace for PWR links 2021-05-30 00:07:18 +01:00
Harvey Tindall 89fb3fa619
Matrix: Notifications 2021-05-29 21:05:12 +01:00
Harvey Tindall a6447165b7
add email notify enable/disable; remove (de)hyphening
hyphen/dehyphen conflicted with new migration for email contact
preference, and it's been a while since this has been an issue so i've
just commented it out for now.
2021-05-21 22:46:46 +01:00
Harvey Tindall f8f5f35cc1
PIN verification, notifications, multiple notif providers
Discord, Email & Telegram can be enabled, although email is always
enabled right now (will fix). Also apparently markdown hyperlinks don't
work in Discord, eventually will implement something to convert them to
embeds.
2021-05-21 21:35:25 +01:00
Harvey Tindall 18bcd55972
remove debug println 2021-05-17 01:32:22 +01:00
Harvey Tindall 057f306ed9
hide/ignore ssl_cert when on windows
x509.SystemCertPool is unavailable on windows, so any value is ignored
and the setting is hidden on the web UI.
2021-05-17 01:16:59 +01:00
Harvey Tindall 33f8070e57
cleanup; fix stripping with DEBUG=on 2021-05-16 15:00:13 +01:00
Harvey Tindall ea0293bd4e
Split some settings into new "messages" section
Most email dependant sections now depend on this. Also renamed more
email things.
2021-05-07 21:53:29 +01:00
Harvey Tindall 36edd4ab0d
Telegram: Use markdown for custom emails/announcements
Had no idea telegram supported this, pretty cool.
2021-05-07 16:33:44 +01:00
Harvey Tindall 716d6a931a
Telegram: Send messages via telegram
Most messages are now sent as plaintext via telegram when suitable.
2021-05-07 16:06:47 +01:00
Harvey Tindall 99875b9176
almost complete telegram user verification
When signing up, the user is given a pin code which they send to a
telegram bot. This provides user verification, but more importantly
allows the bot to message the user, as the Telegram API requires the
user to interact with the bot before it can do the opposite.

The bot should recognize the correct language, but a /lang command is
also provided to change it.

The verification process is pretty much functional but ui is still
broken, and it isn't properly integrated yet.
2021-05-07 01:08:12 +01:00
Harvey Tindall 488c2f5df5
fix broken url in welcome email 2021-05-02 14:44:19 +01:00
Harvey Tindall 59a014f681
fix title for invite emails 2021-05-02 12:50:04 +01:00
Harvey Tindall 8fdab39b18
use templateEmail and show conditionals in editor 2021-04-15 15:34:17 +01:00
Harvey Tindall 55e21f8be3
accounts: add user enable/disable & emails 2021-04-12 21:28:36 +01:00
Harvey Tindall 7a3e0d60f9
add expiry to welcome email, add dummy emailer for debugging
the "yourAccountWillExpire" has also been added to the editor for #81.
To use the dummy emailer, set [email]/method to "dummy".
2021-04-08 14:20:13 +01:00
Harvey Tindall 3f8414c70a
use unix timestamp for inv created & usedBy
usedBy is still stored as a string in invites.json to cope with existing
invites with times stored formatted. knz/strtime requires cgo for
strptime, so it has been replaced with the native itchyny/timefmt-go.
2021-04-06 21:25:44 +01:00
Harvey Tindall 30f16e7207
email: use strconv.Itoa instead of sprintf 2021-04-02 15:56:34 +01:00
Harvey Tindall 9370913ace
add password reset link option
When enabled (in Settings > Password Resets), a magic link will be sent
instead of a PIN when the user tries reset their password. By doing
this the user doesn't have to keep the Jellyfin tab open to enter the
code.
2021-03-30 22:41:28 +01:00
Harvey Tindall 43e5bbbe21
add option to trust specific cert for SMTP 2021-03-15 21:57:42 +00:00
Harvey Tindall 1e9d184508
implement user expiry functionality
All works now, but i'll add a field on the accounts tab for users with
an expiry, as well as a 'disabled' badge.
2021-02-28 15:41:06 +00:00
Harvey Tindall 40fc5e9604
Fix email editor when plaintext setting enabled 2021-02-22 16:40:37 +00:00
Harvey Tindall 52d9cda61a
Move email rendering to browser
the email preview no longer has a delay after each change. This also
avoids a race condition in which the email currently being edited could
be actually sent.
2021-02-22 00:43:36 +00:00
Harvey Tindall 058cac2e7b
implement email editor w/ live(?) preview
not accessible in the ui currently, but the object is available as
window.ee for testing.
2021-02-20 22:49:59 +00:00
Harvey Tindall 938523c18b
fix urls in custom email/announcements
Uses a nasty algorithm found in stripmd.go to change all occurrences
of '[linktext](link)' to just 'link' before passing to a decent markdown
stripper.
2021-02-20 01:03:11 +00:00
Harvey Tindall cc4e12c405
finish backend of custom emails
biggest bodge i've ever done but it works i guess.
2021-02-20 00:22:40 +00:00
Harvey Tindall eb406ef951
Implement email template generation
Variables are surrounded by {}, and initial (default) templates are
generated on demand from the plaintext version of emails. The custom
emails are intended to only be used if the user actually changes them,
as they lose the features of the default ones, such as tables.
2021-02-19 21:38:20 +00:00
Harvey Tindall 5c87d109a3
use descriptive variable names in email translations
in preparation for an email editor.
2021-02-19 17:50:50 +00:00
Harvey Tindall 93b5b483cc
add plaintext email option, use text/template
text/template is used on plaintext emails to avoid escaping of certain
characters.
2021-02-18 18:26:23 +00:00
Harvey Tindall 27ef931670
add possible dark mode fix for Outlook 2021-02-18 17:47:15 +00:00
Harvey Tindall fa433c88a8
add announcement emails
After selecting users in the accounts tab, you can press 'Announce',
then write a subject and message (with markdown), and an email will be
sent to each selected user.
2021-02-18 14:58:53 +00:00
Harvey Tindall ea99966057
refactor, move route loading to router.go 2021-02-12 14:59:16 +00:00
Harvey Tindall fefe2d82a4
rebase 12/02, use go1.16rc1 in make, remove ioutil, start switching to io/fs for file i/o
ioutil's contents are now in io and os.
Eventually jfa-go's files will be embedded in the binary with go1.16's
new embed feature. Using io/fs will provide abstraction for accessing
these files, and allow for both embedded and non-embedded versions.
Also, internal paths to things like email templates, etc. will be
prefixed with "jfa-go:" to indicate to use the app's own Filesystem
instead of reading the file normally. This also allows for custom files
to continue to be used as they are currently.
2021-02-12 14:27:01 +00:00
Harvey Tindall ee026714d4
Add optional email confirmation
If enabled, a confirmation email will be sent before the user can create
their account.
2021-01-30 19:19:12 +00:00
Harvey Tindall ea262ca60b
add optional welcome email for new users
When enabled, an email with the server URL and username will be sent to
created users. Requested in #38.
2021-01-24 15:19:58 +00:00
Harvey Tindall cd2ea2e579
reload email after lang is loaded
fixes #37.
2021-01-21 18:57:32 +00:00
Harvey Tindall e834445b0b
Restructure language loading to support incomplete translations
On startup, files are scanned and any missing values are replaced with
the english version.
2021-01-19 00:29:29 +00:00
Harvey Tindall bc99dc34ee
Add email translation, add part of french translations
Admin translation from @Killianbe, Email translation from
@Cornichon420. French is currently not functional, a few things are
missing which i'm waiting on.
2021-01-15 14:43:32 +00:00