DH-IT-Portal-Development / ethics

Ethical Committee web application in Django
http://fetc.hum.uu.nl
MIT License
2 stars 1 forks source link

Move to uil.core mailing system #273

Open tymees opened 2 years ago

tymees commented 2 years ago

While we moved to using uil.core a while ago, we're still using Django's mailing system instead of the one in uil.core.

As our own version supports templated (read: HTML) mails, it might be time to make use of that. But I'd definitely call it low-priority for now. In fact, we might want to wait till version 2.1 is out of alpha, as I'm planning to include a base template for e-mails in that release. (At the moment, all apps using the mail system use their own base template).

tymees commented 2 years ago

So DSC 3 RC.1 introduced an even fancier mailing system that doesn't require 2 templates per mail anymore, it might be time to work on switching over.

However, there are some considerations:

Do we still want 2 templates for every mail? The obvious downside of having two templates is the work of making sure they are both correct. However, there is also a major downside to to switching to the 1-template-only model, namely links.

The new system automatically generates the missing template if only one is supplied. Thus, if we use plain text templates only, it will generate a HTML version for us. The downside here is that we don't have HTML markup and thus have to paste links plainly (thus, no nice 'click here'). This isn't as nice as we have now.

Going the other route, only having HTML templates gives us the opposite problem. We'd have nice links but the links are stripped from the text, resulting in just plain text with nothing to navigate to. We could solve this by adding a 'if this link doesn't work, copy paste this' line to the mail. But that looks a bit messy imo.

I think I'd prefer to use HTML templates only, and dump the plain links into the footer. But I'd like hear your opionion as well @miggol and @Meesch

What are our mails going to look like? The new template is quite flexible, with multiple optional parts and styling tools. (Mostly because some apps required a lot but I didn't want all that to be mandatory).

The optional parts are:

Some examples (these are some test emails I made, there are some small formatting changes in the final version)

A mail with all parts: image

A mail with only a footer: image

A mail with only a sender: image (This one is a tad wider, ignore that, the other 2 examples are using the final width)

I'm in favor of using a sender and a footer, but I know that @miggol has some strong feelings about this :P

There are some other styling options, but I'd rather discuss those after agreeing on this first.

tymees commented 2 years ago

Oh tip:

If y'all want to play around with the new mail template I'd suggest firing up the DSC dev project; the 'custom email editing form' page can be used to play around with it.

Meesch commented 2 years ago

I do not understand what causes the links to be stripped from the text in the second option: how does this happen and does that happen frequently?

tymees commented 2 years ago

Our code strips it intentionally. When creating a plain text version automatically from HTML, it strips out all HTML tags and only leaves the text inside. So: <a href="https://meep.nl">meep!</a> would become meep!.

Otherwise you'd have a lot of HTML, making the plain text version almost unreadable.

Meesch commented 2 years ago

Okay, but that seems to be a problem inherent to creating plaintext files. In that case I completely agree with you that the second option adds a better experience compared to what we had before for HTML, and not a worse experience for plaintext.