foodcoops / foodsoft

Web-based software to manage a non-profit food coop (product catalog, ordering, accounting, job scheduling).
https://foodcoops.net/
Other
326 stars 146 forks source link

Message Formatting (markdown / html support) #918

Closed yksflip closed 1 year ago

yksflip commented 2 years ago

Hi!

Is it possible to use markdown or html syntax to format messages in the Foodsoft message system? Or is there maybe a simple way to add this feature? Our Members use the foodsoft message system as main communication system and do not find the plaintext messages very clear.

Best regards, Philipp

wvengen commented 2 years ago

Thanks for the suggestion! I agree that the message mails could be a lot more beautiful. Adding formatting options would be nice - ActionText could make sense here, though we're still on Rails 5, which doesn't include it by default (but I guess it could be added as a gem in the meantime).

In my mind, the first step would be more beautiful mails (html + plain text), for Foodsoft in general, then adding formatting in message composition.

yksflip commented 1 year ago

I managed to add a richtexteditor to send messages with ActionText with this two commits:

Once we've got the rails upgrade merged I'll open a PR for this!

About the email html template I feel a bit unsure how to do it properly. I tried to do something simple as just making the footer urls tags and it required some changes in the i18n, because urls are passed as arguments. Not sure what's a good way to do this nicely for html and plaintext.

wvengen commented 1 year ago

Ah, very nice!

Not sure if current messages can use wiki-syntax, if so:

Regarding the html/text issue in email: what about extracting text from html and using that as plaintext?

yksflip commented 1 year ago

There was no formatting options for messages before. But the wiki is a good hint, maybe we could introduce actiontext there in the future as well. Not sure if I understand you correctly. Converting the message body to plaintext is not the problem. What I was struggling with, was how to reduce duplication for both email views. e.g. for the foodsoft_message.html.haml that renders the message footer, there's now some duplicates in the locales with, and without url parameter. But maybe that's okay for now as it's just that one template., we can dicuss this in the pr once opened. I guess this will be more relevant when adding html templates for all email views.

yksflip commented 1 year ago

see #1013