Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-2802

Add subject for course reminder email

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 11.4.3
    • Fix Version/s: 12.0
    • Component/s: Course
    • Labels:
      None

      Description

      Many people find that the email subject of reminders ("Kurserinnerungen") is not very helpful in most cases They want an editable email subject for the reminder. We could use the description, however this is a field meant for authors to organise their reminder mails.

      For example, the could be the reminders with the name "frist week reminder", "second week reminder", however the subject for those reminders would rather be "Welcome to the course xyz" and "Check out program of week two". Sometimes the same reply applies for different reminders, e.g. because there are different rules for different type of users but all should have the same mail subject. 

      Also many people delete the default mail text so the course context is lost in the mail. I check if the mail text contains the course information and if not, I append it to the text.

       

      This is the original patch (not directly applied, but inspired upon):

      diff --git a/src/main/java/org/olat/course/reminder/ui/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/course/reminder/ui/_i18n/LocalStrings_de.properties
      --- a/src/main/java/org/olat/course/reminder/ui/_i18n/LocalStrings_de.properties
      +++ b/src/main/java/org/olat/course/reminder/ui/_i18n/LocalStrings_de.properties
      @@ -23,7 +23,7 @@
       passed=Bestanden
       points=Punkte
       reminder.def.body=<p>Liebe(r) $firstname $lastname</p><p>Sie haben sich in den Kurs "$coursename" eingetragen. Jetzt w\u00E4re ein guter Zeitpunkt diesen zu besuchen\!</p><p>$courseurl</p><p>Viele Gr\u00FCsse</p>
      -reminder.description=Beschreibung
      +reminder.description=Beschreibung / E-Mail-Betreff
       reminder.id=ID
       reminder.resend=Erinnerung wurde erfolgreich geschickt.
       reminders=Erinnerungen
      diff --git a/src/main/java/org/olat/course/reminder/ui/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/course/reminder/ui/_i18n/LocalStrings_en.properties
      --- a/src/main/java/org/olat/course/reminder/ui/_i18n/LocalStrings_en.properties
      +++ b/src/main/java/org/olat/course/reminder/ui/_i18n/LocalStrings_en.properties
      @@ -23,7 +23,7 @@
       passed=Passed
       points=Points
       reminder.def.body=<p>Dear $firstname $lastname</p><p>You are registered in the course "$coursename". Now would be a good time to view it!</p><p>$courseurl</p><p>Best regards</p>
      -reminder.description=Description
      +reminder.description=Description / email subject
       reminder.id=ID
       reminder.resend=Reminder was successfully sent.
       reminders=Reminders
      diff --git a/src/main/java/org/olat/modules/reminder/manager/ReminderServiceImpl.java b/src/main/java/org/olat/modules/reminder/manager/ReminderServiceImpl.java
      --- a/src/main/java/org/olat/modules/reminder/manager/ReminderServiceImpl.java
      +++ b/src/main/java/org/olat/modules/reminder/manager/ReminderServiceImpl.java
      @@ -243,8 +243,13 @@
       		
       		MailContext context = new MailContextImpl("[RepositoryEntry:" + entry.getKey() + "]");
       		Translator trans = Util.createPackageTranslator(ReminderAdminController.class, I18nModule.getDefaultLocale());
      -		String subject = trans.translate("reminder.subject");
      +		String subject = reminder.getDescription();
       		String body = reminder.getEmailBody();
      +		if (body.contains("$courseurl")) {
      +			body = body.replace("$courseurl", "<a href=\"$courseurl\">$courseurl</a>");
      +		} else {
      +			body = body + "<p>--<br>Erinnerung aus Kurs <a href=\"$courseurl\">$coursename</a></p>";
      +		}
       		String metaId = UUID.randomUUID().toString();
       		String url = Settings.getServerContextPathURI() + "/url/RepositoryEntry/" + entry.getKey();
       
      

        Attachments

          Activity

            People

            Assignee:
            gnaegi Florian Gnägi
            Reporter:
            stephan Stephan Clemenz
            Tester:
            Sabrina Scheiwiler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 10 minutes
                1h 10m