Experiment: Add user invitation in-product marketing email
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
How to set up and validate locally
-
Enable
:invite_team_email
feature flag inrails console
:Feature.enable(:invite_team_email)
-
Create a top-level group for a company without inviting other users
-
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 inapp/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! -
Click on
Invite your teammates to help
CTA button in the email -
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.
-
I have evaluated the MR acceptance checklist for this MR.