Mail: include markdown in mails
- add markdown rendering. Also always escape HTML in markdown output
- use UI form in ilMailFormGUI and add Markdown for Message
- enable markdown for free text mails
- include new functions in form and buttons to avoid a redirect of the page if the user clicked onto the placeholders to insert them into the mail
- adjust template rendering in 'withAdditionalOnLoadCode' if coming from a context
- adjust PHPUnit Tests
- use ResourceCollection for uploading/showing file information
This PR replaces Draft 7779 which is now closed.
It was decided with @mjansenDatabay that we will use the ResourceCollection for storing, converting and displaying the file data instead of rebuilding everything to IRSS. The needed functions can be found in a trait file as they are needed multiple times.
The placeholders underneath the message field are always visible as there's currently no UI alternative to the "old" implementation.
The search for recipients (in the tag input fields to, cc, bcc) still might take a long time to load as it was decided that we wait for an server source extension from Stefan K.
In addition I created three more PR's you could check out:
- Underline Extension for Markdown
- Adjusting the Markdown's Headline configuration, which is also needed for the underline extension PR
- Optional Markdown Extension with emphasis rendering
Hi @mjansenDatabay,
could you have another look at this? Feel free to ping @lukastocker for a rebase if we are approaching a merge.
Kind regards!
@lukastocker Could you please:
- Remove the markdown extension that we have in the other PRs. They should be independent from this...
- Open a single PR for the changes in the UI framework (but still leave the changes in here...)
Ping me afterwards please =)
Thanks!
Hi @klees ,
I will have a look (end of) next week.
Best regards, Michael
@lukastocker Could you please:
- Remove the markdown extension that we have in the other PRs. They should be independent from this...
- Open a single PR for the changes in the UI framework (but still leave the changes in here...)
Ping me afterwards please =)
Thanks!
Hi @klees ,
i just updated this PR (removal of markdown extension) and added following new PR's:
I will be next week, sorry ...
And: Thanks for your changes, Luka.
Hi @mjansenDatabay ,
as I can't check the boxes in your comment I will list the changes pushed last below:
- unnecessary code was reverted/removed
- fetching mail data includes a check for serialized strings and unserializes them. This resulted in some changes for e.g. draft mails too as unserializing was already done during fetching the mail data
- table mail and mail_saved column type were adjusted (text and clob)
- return values (array
) were adjusted accordingly - PHPUnit tests were adjusted
- the GUI tests you mentioned were performed successfully
- encoding/decoding and transformation steps with legacy mails were tested successfully
- I pulled the current trunk code and resolved conflicts
Greetings Luka
@lukastocker I noticed one issue when using your branch. When clicking on a placeholder in the mail form, the form gets submitted and validated. This should be changed.
I imlemented a "User Search"-based recipient search here https://github.com/mjansenDatabay/ILIAS/tree/tr_mark_final_autocomplete (it will always be the latest commit in this branch, not matter how often I'll rebase the branch).
Hi @mjansenDatabay , the placeholder issue is now resolved. Also html will be rendered correctly for e.g. print view etc. and the required option was removed from the mail content area. In addition I cherry-picked your user search commit to this branch
FYI: I will try to review the UI changes today/tomorrow and implement some (or all) of the requested changes inside another PR myself, which I will open against @lukastocker's base repository. This should speed up things so we can get this included in ILIAS 11.
Hi @thibsy ,
I just pushed following changes:
- reverted some changes in file.js because they got lost through the last cherry-picks, which resulted into false additional button actions
- implemented changes into the interface
- wrote some PHPUnit tests
- added example descriptions and expected outputs
- rebased trunk with this PR
- styled the mustache variables listing via scss and deleted unnecessary scss regarding markdown preview
Currently there's is a problem with saving and sending attachments. I will look into it on monday.
Hi @thibsy , @mjansenDatabay
I updated this PR with following fixes:
- attachments can be saved as draft and send as some function got lost during the cherry pick.
- placeholders are now rendered correctly if a mail was saved. It already worked for sending mails.
- adjusted the code according to the comments above for some parts. After some debugging with thibsy we decided to leave the submitter actions in the file.js as they are for now. Comments were added in the file as the file.js should get refactored at some point.
- adjusted the example output descriptions.
- rebased PR with the trunk branch to avoid missing code and/or conflicts
I tested the functionality via GUI and ran PHPUnit tests.
Note, that currently there are some issues with the data selection in the data table. This seems to be a general issue as it does not work in the UI docu too. I think we should not fix it in this PR as it is not part of the mail markdown topic.
@smeyer-ilias / @kergomard Is there any chance you can review this until ~ 4 PM/16:00 ?
Jour Fixe, 10 NOV 2025: Yvonne notified us about changes in the public interface through this PR. Changes were already committed to trunk before release 11 branch has been created and are therefore available in ILIAS 11, too.