Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix email issues #171

Merged
merged 28 commits into from Oct 5, 2021
Merged

Fix email issues #171

merged 28 commits into from Oct 5, 2021

Commits on Sep 30, 2021

  1. Enrich and personalise the role request emails.

    * Add the entity the role was requested on into the message
    * Add context and personalise role request emails
    
    Co-authored-by: ineilson <ian.neilson@stfc.ac.uk>
    2 people authored and gregcorbett committed Sep 30, 2021
    Copy the full SHA
    a8b6022 View commit details
    Browse the repository at this point in the history
  2. Factor out preparation and sending of email to a seperate function

    This somewhat improves readability.
    jrha authored and gregcorbett committed Sep 30, 2021
    Copy the full SHA
    e1ef4cd View commit details
    Browse the repository at this point in the history
  3. Remove commented out code cruft

    jrha authored and gregcorbett committed Sep 30, 2021
    Copy the full SHA
    08b7a7a View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2021

  1. Remove if statement from NotificationService call

    - it's not up to this piece of code to determine if
      emails should be sent to the used.
    - that is currently done by the NotificationService itself.
    gregcorbett committed Oct 1, 2021
    Copy the full SHA
    3ee8160 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    a262b85 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    e69c8bb View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    6db804d View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    3382f89 View commit details
    Browse the repository at this point in the history
  6. Read send_email from config file and act appropriately

    Remove hardcoded sendmail "test"
    jrha authored and gregcorbett committed Oct 1, 2021
    Copy the full SHA
    4462025 View commit details
    Browse the repository at this point in the history
  7. Move headers next to where it is used

    jrha authored and gregcorbett committed Oct 1, 2021
    Copy the full SHA
    f2f02ac View commit details
    Browse the repository at this point in the history
  8. Remove redundant code paths

    This seems to have originally been factored out as part of 229a0e8
    and has been sitting around since then.
    jrha authored and gregcorbett committed Oct 1, 2021
    Copy the full SHA
    3c9bbd9 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    d755b31 View commit details
    Browse the repository at this point in the history
  10. Fix from header and set email address to admin list

    Fixes GOCDB#168 (emails "from GOCDB" should come from gocdb-admins@mailman.egi.eu).
    jrha authored and gregcorbett committed Oct 1, 2021
    Copy the full SHA
    7df9d51 View commit details
    Browse the repository at this point in the history
  11. Handle case where no user has a role over entity

    Co-Authored-By: ineilson <ian.neilson@stfc.ac.uk>
    gregcorbett and ineilson committed Oct 1, 2021
    Copy the full SHA
    b156c28 View commit details
    Browse the repository at this point in the history
  12. Use the role requested object to populate email

    - this way, if a site role request gets passed up to an NGI level
      user, they will see the site name in the request (not the NGI
      name).
    gregcorbett committed Oct 1, 2021
    Copy the full SHA
    9b8b9f2 View commit details
    Browse the repository at this point in the history
  13. Always recurse roleRequest when project role needed

    - I guess this logic was somewhat there to test /stop recursion
      if you didn't want to send an email.
    - The logic of whether to send an email or just print what would
      have been sent has been factored out already, so we don't need
      this if statement anymore.
    gregcorbett committed Oct 1, 2021
    Copy the full SHA
    443211e View commit details
    Browse the repository at this point in the history
  14. Copy the full SHA
    845a027 View commit details
    Browse the repository at this point in the history
  15. Use the Factory to access local config

    - to support different views of GOCDB being served by the same instance.
    
    Co-authored-by: ineilson <ian.neilson@stfc.ac.uk>
    gregcorbett and ineilson committed Oct 1, 2021
    Copy the full SHA
    0deddb5 View commit details
    Browse the repository at this point in the history
  16. Remove un-needed code.

    - the behaviour of recursing this function is repeated further
      down.
    gregcorbett committed Oct 1, 2021
    Copy the full SHA
    eb54ec4 View commit details
    Browse the repository at this point in the history
  17. Check array is empty rather than null

    - `if ( empty( $array_name ) )` is more readable. I think we
      previously got away with it because `[] == null` returns true,
      or because the code interchanged empty arrays and `null`.
    gregcorbett committed Oct 1, 2021
    Copy the full SHA
    c49b00c View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2021

  1. Simplify determination of users with GRANT_ROLE

    Co-authored-by: ineilson <ian.neilson@stfc.ac.uk>
    gregcorbett and ineilson committed Oct 4, 2021
    Copy the full SHA
    6efb29b View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    eac6b74 View commit details
    Browse the repository at this point in the history
  3. Use camelCase throughout

    gregcorbett committed Oct 4, 2021
    Copy the full SHA
    34bf0a8 View commit details
    Browse the repository at this point in the history
  4. Factor out email sending into its own service

    - for later reuse.
    gregcorbett committed Oct 4, 2021
    Copy the full SHA
    569fcde View commit details
    Browse the repository at this point in the history
  5. Update documentation of NotificationService class

    Co-authored-by: ineilson <ian.neilson@stfc.ac.uk>
    gregcorbett and ineilson committed Oct 4, 2021
    Copy the full SHA
    1e0ad98 View commit details
    Browse the repository at this point in the history
  6. Capitalise "GocDB" in lib/Gocdb_Services/NotificationService.php

    Co-authored-by: ineilson <ian.neilson@stfc.ac.uk>
    gregcorbett and ineilson committed Oct 4, 2021
    Copy the full SHA
    82abbed View commit details
    Browse the repository at this point in the history
  7. Add requesting User's surname to emails

    - for clarity, as the email could be someone outside their entity.
    - i.e, a Site role request email going to someone with a role
      over an NGI.
    gregcorbett committed Oct 4, 2021
    Copy the full SHA
    6f6d342 View commit details
    Browse the repository at this point in the history
  8. Remove unneeded check for emptiness

    - this check is part of the `else` of an
      `if (count($authorisingUserIds) == 0)` statement.
    - `array_unique` won't empty `$authorisingUserIds`.
    - hence, the check here isn't needed.
    
    Co-authored-by: ineilson <ian.neilson@stfc.ac.uk>
    gregcorbett and ineilson committed Oct 4, 2021
    Copy the full SHA
    1dce398 View commit details
    Browse the repository at this point in the history