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

Gmail strips out insights styling

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Prerequisites

      We need 2 email accounts whose emails are displayed in gmail:

      1. One account to send emails using gmail's SMTP service, don't use your personal account (ask the issue's assignee for details if you don't have one you can use for testing)
      2. One account to receive emails, a personal account can be used

      Test

      1. Log in as admin
      2. Untick 'onlycli' in site admin > analytics > analytics settings
      3. Make sure you don't have $CFG->noemailever = true; in your config.php
      4. Set a noreplyaddress (e.g. asdasdasdas@example.com) in site admin  > Server > Email > Outgoing mail configuration
      5. Set your SMTP settings in moodle in site admin > server > email > outgoing mail configuration
        1. Hosts to smtp.gmail.com:465
        2. Security to SSL
        3. Auth type to Login
        4. Username to email-#1-described-above@gmail.com (not a personal one)
        5. Password to the-gmail-account-password
      6. You can test that it works fine using the Test outgoing mail configuration link
        1. If it does not work log into gmail using the account you set in the SMTP config, go to https://myaccount.google.com/lesssecureapps and allow less secure apps
      7. Set up a course with 1 assignment with due date in +2 days (I did it by creating a XS test course in site admin > development > make test course and updating the due date)
      8. Enrol a student xxx on the course and set email #2 as the student's email
      9. Go to xxx user profile > preferences > notification preferences and make sure that Insights generated by prediction models is ON
      10. Go to site admin > analytics > analytics models
      11. Execute Actions > Clear predictions and Actions > Execute scheduled analysis afterwards for the Upcoming activities due model
      12. Check that you get an email in your #2 email account and check that it looks more or less like the image below.
        • If you are using development site in localhost (likely to be the case) you will not see the activity type image but Activity event instead, this is fine

       

      Show
      Prerequisites We need 2 email accounts whose emails are displayed in gmail: One account to send emails using gmail's SMTP service, don't use your personal account (ask the issue's assignee for details if you don't have one you can use for testing) One account to receive emails, a personal account can be used Test Log in as admin Untick 'onlycli' in site admin > analytics > analytics settings Make sure you don't have $CFG->noemailever = true; in your config.php Set a noreplyaddress (e.g. asdasdasdas@example.com ) in site admin  > Server > Email > Outgoing mail configuration Set your SMTP settings in moodle in site admin > server > email > outgoing mail configuration Hosts to smtp.gmail.com:465 Security to SSL Auth type to Login Username to email-#1-described-above@gmail.com (not a personal one) Password to the-gmail-account-password You can test that it works fine using the Test outgoing mail configuration link If it does not work log into gmail using the account you set in the SMTP config, go to https://myaccount.google.com/lesssecureapps and allow less secure apps Set up a course with 1 assignment with due date in +2 days (I did it by creating a XS test course in site admin > development > make test course and updating the due date) Enrol a student xxx on the course and set email #2 as the student's email Go to xxx user profile > preferences > notification preferences and make sure that Insights generated by prediction models is ON Go to site admin > analytics > analytics models Execute Actions > Clear predictions and Actions > Execute scheduled analysis afterwards for the Upcoming activities due model Check that you get an email in your #2 email account and check that it looks more or less like the image below. If you are using development site in localhost (likely to be the case) you will not see the activity type image but Activity event instead, this is fine  
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-66807_master

      Description

      I've just got the first insight into my gmail inbox and I see that the styling is stripped out by gmail, this is a possible cause of it: https://litmus.com/community/discussions/6241-gmail-stripping-inline-css-out We are using the body:not() trick to avoid these styles to be applied in the moodle web UI as it has its own styling. We don't want the email styles to interfere with the Moodle web UI ones as themes can be customised and the UI would change according to it. I am flagging this as a must fix because email is the most likely way to consume insights and we dedicated significant efforts in 3.8 to improve how these insights look like.

       

      The link below should be displayed as a button.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dmonllao David Monllaó
              Reporter:
              dmonllao David Monllaó
              Peer reviewer:
              Jake Dallimore
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Simey Lameze
              Participants:
              Component watchers:
              Elizabeth Dalton, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours, 50 minutes
                  6h 50m