Skip to content

Experiment: Add user invitation in-product marketing email

Eugie Limpin requested to merge invite-users-email-experiment into master

What does this MR do and why?

This MR is implementation step 2 for #342980 (closed).

It implements the experiment to deliver an email (added in !72849 (merged)) prompting a user to invite their teammates 20 minutes after creating a top-level group.

Conditions for email delivery

Following are the conditions that should be met for an email to get sent:

  • Instance is gitlab.com (or dev env)
  • The created group is top-level
  • The group is set up for a company (a checkbox option in the group create form)
  • The user has permission to invite members to the group
  • The user has opted in to receive in-product marketing emails
  • There are no added or invited users to the group 20 minutes after it was created
  • The user hasn't receive the same email before (for any group)

Screenshots or screen recordings

demo

How to set up and validate locally

  1. Enable :invite_team_email feature flag in rails console:

    Feature.enable(:invite_team_email)
  2. Create a top-level group for a company without inviting other users

    Form to create a group for a company (without inviting other users) Screen_Shot_2021-10-25_at_2.08.09_PM
  3. Wait for 20 minutes, go to Letter Opener, and verify the following email has been received:

    Note: You can change the value of DELIVERY_DELAY_IN_MINUTES constant in app/services/namespaces/invite_team_email_service.rb to control the delay

    🆘 If you're having trouble viewing the email in letter opener (CSP problem?) it might be because of the issue that !72830 (merged) is trying to fix. Don't hesitate to let me know if you need help testing!

    Invite team email Screen_Shot_2021-10-25_at_2.42.00_PM
  4. Click on Invite your teammates to help CTA button in the email

  5. Verify that you are redirected to http://127.0.0.1:3000/groups/<group-slug>/-/group_members

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 Eugie Limpin

Merge request reports