Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-40081

Allow to decide whether to use title site or short description in subject when notifying an announcement via email

    Details

    • Type: Task
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 12.2, 19.0
    • Fix Version/s: 12.3
    • Component/s: Announcements
    • Labels:
    • 12 status:
      Resolved
    • Property addition/change required:
      Yes
    • Test Plan:
      Hide
      1. Activate property "announcement.email.use.short.description=true" in Sakai
      2. Access to a site as a instructor
      3. Set a short description for the site
      4. Create an announcement
      5. Check that, in the email sended, the title site is shown in the "from" section but not in the "subject" section. In the subject section the short description is shown, along with the announcement subject.
      6. If there is no short description or the property is not activated, the site title will be shown in the "subject" section of the email.
      Show
      Activate property "announcement.email.use.short.description=true" in Sakai Access to a site as a instructor Set a short description for the site Create an announcement Check that, in the email sended, the title site is shown in the "from" section but not in the "subject" section. In the subject section the short description is shown, along with the announcement subject. If there is no short description or the property is not activated, the site title will be shown in the "subject" section of the email.

      Description

      When notifying a new announcement, the title site is already indicated in the "from" section of the email, so there is no need to repeat it in the subject.

      It is necessary to change the code below in the "SiteEmailNotificationAnnc" class:

      protected String getSubject(Event event)
      {
      // get the message
      Reference ref = entityManager.newReference(event.getResource());
      AnnouncementMessage msg = (AnnouncementMessage) ref.getEntity();
      AnnouncementMessageHeader hdr = (AnnouncementMessageHeader) msg.getAnnouncementHeader();

      // use either the configured site, or if not configured, the site (context) of the resource
      String siteId = (getSite() != null) ? getSite() : ref.getContext();

      // get a site title
      String title = siteId;
      try
      {
      Site site = siteService.getSite(siteId);
      title = site.getTitle();
      }
      catch (Exception ignore)
      {
      }

      // use the message's subject
      return rb.getFormattedMessage("noti.subj", new Object[]{title, hdr.getSubject()});
      }

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                adrianmticarum Adrian Martinez
                Reporter:
                adrianmticarum Adrian Martinez
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code