Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49682

Forum email template is not editable by themes

XMLWordPrintable

    • MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_30_STABLE
    • MDL-49682-master
    • Easy
    • Hide
      Setup
      1. Create a course
      2. Enrol six students in it
      3. Create a single group and place all students in it
      4. Set a group picture
      5. Create a new forum (in addition to the news forum) and put into separate groups mode.
      6. Modify each of the student's profile to select one of the three forum digest options (No digest, Digest, Subject-only digest), and one of the Email formats (Plain vs. Pretty under Message settings). (i.e. one of each combination)
      Test
      1. Write a new post in the News forum. Consider using a Lipsum generator and including a variety of content.
      2. Update your database:

        UPDATE mdl_config SET value = '3' where name = 'digestmailtime';
        UPDATE mdl_config SET value = '0' where name = 'digestmailtimelast';
        

      3. Run the forum scheduled task:

        php admin/tool/task/cli/schedule_task.php --execute="\mod_forum\task\cron_task"
        

      4. Check the e-mail accounts of each of the users
        1. Confirm that each user received the appropriate type of email
        2. Confirm that each anchor link is correct
        3. Confirm that there is no 'reply' link in the e-mail
        4. Confirm that the user picture has an appropriate URL
      5. Repeat the process for the standard forum which each user is able to reply to posts within - make sure that you post to the group, and not to "All students"
        1. Confirm that each user received the appropriate type of email
        2. Confirm that each anchor link is correct
        3. Confirm that there is a 'reply' link in the e-mail
        4. Confirm that the user picture has an appropriate URL
        5. Confirm that the group picture has an appropriate URL
      Additional testing
      1. Grab the attached test.php from this issue and place it in the Moodle root directory
      2. Modify it for each of the forum posts you wrote before (it uses the postid)
      3. Run the test script
        1. Check that the output looks pretty reasonable (sorry - this is hard to define. Use common sense and judgement)
      Show
      Setup Create a course Enrol six students in it Create a single group and place all students in it Set a group picture Create a new forum (in addition to the news forum) and put into separate groups mode. Modify each of the student's profile to select one of the three forum digest options (No digest, Digest, Subject-only digest), and one of the Email formats (Plain vs. Pretty under Message settings). (i.e. one of each combination) Test Write a new post in the News forum. Consider using a Lipsum generator and including a variety of content. Update your database: UPDATE mdl_config SET value = '3' where name = 'digestmailtime'; UPDATE mdl_config SET value = '0' where name = 'digestmailtimelast'; Run the forum scheduled task: php admin/tool/task/cli/schedule_task.php --execute="\mod_forum\task\cron_task" Check the e-mail accounts of each of the users Confirm that each user received the appropriate type of email Confirm that each anchor link is correct Confirm that there is no 'reply' link in the e-mail Confirm that the user picture has an appropriate URL Repeat the process for the standard forum which each user is able to reply to posts within - make sure that you post to the group, and not to "All students" Confirm that each user received the appropriate type of email Confirm that each anchor link is correct Confirm that there is a 'reply' link in the e-mail Confirm that the user picture has an appropriate URL Confirm that the group picture has an appropriate URL Additional testing Grab the attached test.php from this issue and place it in the Moodle root directory Modify it for each of the forum posts you wrote before (it uses the postid) Run the test script Check that the output looks pretty reasonable (sorry - this is hard to define. Use common sense and judgement)

      The current forum email template is not editable except through core hacks.

      Bits of the text are distributed across several language strings.

      My use case is that we want to top and tail the forum content with some contextual text about the site it is coming from (add language), while others seem to have layout constraints discussed here:
      https://moodle.org/mod/forum/discuss.php?d=254183

      The proposal seems to be to move the function to a renderer so that it can be over-ridden.

      This would allow the layout to be determined in the theme and for additional language strings to be added here as well and so seems to address both use cases.

      Current functions that generate this:

      • forum_make_mail_html
      • forum_make_mail_text
      • forum_make_mail_post

      Considerations

      The digest calls the forum_make_mail_* copy so this would be impacted by the same renderer. It might be that passing a digest parameter would give more flexibility to altering the display if required.

            dobedobedoh Andrew Lyons
            jballard James Ballard
            John Okely John Okely
            David Monllaó David Monllaó
            Simey Lameze Simey Lameze
            Votes:
            6 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.