Skip to content

Send e-mail when achievements are awarded

What does this MR do and why?

Adds a notification e-mail when an achievement is awarded.

Related to #403315 (closed)

Screenshots or screen recordings

image

The first hyperlink is for the namespace which awarded the achievement and the last hyperlink is to the user profile.

How to set up and validate locally

  • See some achievements (if you don't already have some in your database): FILTER=achievements rake db:seed_fu
  • Award an achievement:
    mutation {
    achievementsAward(input: {
      achievementId: "gid://gitlab/Achievements::Achievement/1",
      userId: "gid://gitlab/User/1" }) {
      userAchievement {
        id
        achievement {
          id
          name
        }
        user {
          id
          username
          name
        }
        awardedByUser {
          username
        }
        revokedByUser {
          username
        }
        createdAt
        updatedAt
        revokedAt
      }
      errors
    }
    }
  • Check the sent e-mail: http://gdk.test:3000/rails/letter_opener/

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Lee Tickett

Merge request reports

Loading