Commit fdecd2cd authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'add-start-trial-track-to-onboarding-emails' into 'master'

Add trial_short track to in-product marketing emails

See merge request gitlab-org/gitlab!66943
parents 5f538752 f74e5e53
......@@ -38,7 +38,7 @@ class Groups::EmailCampaignsController < Groups::ApplicationController
create_track_url
when :verify
project_pipelines_url(group.projects.first)
when :trial
when :trial, :trial_short
'https://about.gitlab.com/free-trial/'
when :team, :team_short
group_group_members_url(group)
......
......@@ -20,7 +20,8 @@ module Users
trial: 2,
team: 3,
experience: 4,
team_short: 5
team_short: 5,
trial_short: 6
}, _suffix: true
scope :without_track_and_series, -> (track, series) do
......
......@@ -13,8 +13,13 @@ module Namespaces
completed_actions: [:git_write],
incomplete_actions: [:user_added]
},
trial_short: {
interval_days: [2],
completed_actions: [:git_write],
incomplete_actions: [:trial_started]
},
verify: {
interval_days: [2, 6, 11],
interval_days: [3, 7, 12],
completed_actions: [:git_write],
incomplete_actions: [:pipeline_created]
},
......@@ -105,7 +110,7 @@ module Namespaces
case track
when :create, :verify
user.can?(:create_projects, group)
when :trial
when :trial, :trial_short
user.can?(:start_trial, group)
when :team, :team_short
user.can?(:admin_group_member, group)
......
......@@ -2,7 +2,7 @@
key_path: counts.in_product_marketing_email_team_short_0_cta_clicked
name: "count_clicks_on_the_first_email_of_the_team_short_track_for_in_product_marketing_emails"
description: Total clicks on the team_short track's first email
product_section:
product_section: growth
product_stage: growth
product_group: group::activation
product_category: onboarding
......
......@@ -2,7 +2,7 @@
key_path: counts.in_product_marketing_email_team_short_0_sent
name: "count_sent_first_email_of_the_team_short_track_for_in_product_marketing_emails"
description: Total sent emails of the team_short track's first email
product_section:
product_section: growth
product_stage: growth
product_group: group::activation
product_category: onboarding
......
---
key_path: counts.in_product_marketing_email_trial_short_0_cta_clicked
name: "count_clicks_on_the_first_email_of_the_trial_short_track_for_in_product_marketing_emails"
description: Total clicks on the trial_short track's first email
product_section: growth
product_stage: growth
product_group: group::activation
product_category: onboarding
value_type: number
status: implemented
milestone: "14.2"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66943
time_frame: all
data_source: database
data_category: Optional
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
---
key_path: counts.in_product_marketing_email_trial_short_0_sent
name: "count_sent_first_email_of_the_trial_short_track_for_in_product_marketing_emails"
description: Total sent emails of the trial_short track's first email
product_section: growth
product_stage: growth
product_group: group::activation
product_category: onboarding
value_type: number
status: implemented
milestone: "14.2"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66943
time_frame: all
data_source: database
data_category: Optional
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
......@@ -2750,6 +2750,34 @@ Status: `data_available`
Tiers: `free`, `premium`, `ultimate`
### `counts.in_product_marketing_email_trial_short_0_cta_clicked`
Total clicks on the trial_short track's first email
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210727170553_in_product_marketing_email_trial_short_0_cta_clicked.yml)
Group: `group::activation`
Data Category: `Optional`
Status: `implemented`
Tiers: `free`, `premium`, `ultimate`
### `counts.in_product_marketing_email_trial_short_0_sent`
Total sent emails of the trial_short track's first email
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210727170558_in_product_marketing_email_trial_short_0_sent.yml)
Group: `group::activation`
Data Category: `Optional`
Status: `implemented`
Tiers: `free`, `premium`, `ultimate`
### `counts.in_product_marketing_email_verify_0_cta_clicked`
Total clicks on the verify track's first email
......
......@@ -68,6 +68,10 @@ module Gitlab
s_('InProductMarketing|Start your trial now!')
][series]
end
def progress
super(current: series + 2, total: 4)
end
end
end
end
......
# frozen_string_literal: true
module Gitlab
module Email
module Message
module InProductMarketing
class TrialShort < Base
def subject_line
s_('InProductMarketing|Be a DevOps hero')
end
def tagline
nil
end
def title
s_('InProductMarketing|Expand your DevOps journey with a free GitLab trial')
end
def subtitle
s_('InProductMarketing|Start your trial today to experience single application success and discover all the features of GitLab Ultimate for free!')
end
def body_line1
''
end
def body_line2
''
end
def cta_text
s_('InProductMarketing|Start a trial')
end
def progress
super(total: 4, track_name: 'Trial')
end
def logo_path
'mailers/in_product_marketing/trial-0.png'
end
end
end
end
end
end
......@@ -16899,6 +16899,9 @@ msgstr ""
msgid "InProductMarketing|Automated security scans directly within GitLab"
msgstr ""
msgid "InProductMarketing|Be a DevOps hero"
msgstr ""
msgid "InProductMarketing|Beef up your security"
msgstr ""
......@@ -16941,6 +16944,9 @@ msgstr ""
msgid "InProductMarketing|Easy"
msgstr ""
msgid "InProductMarketing|Expand your DevOps journey with a free GitLab trial"
msgstr ""
msgid "InProductMarketing|Explore GitLab CI/CD"
msgstr ""
......@@ -17133,6 +17139,9 @@ msgstr ""
msgid "InProductMarketing|Start your trial now!"
msgstr ""
msgid "InProductMarketing|Start your trial today to experience single application success and discover all the features of GitLab Ultimate for free!"
msgstr ""
msgid "InProductMarketing|Stop wondering and use GitLab to answer questions like:"
msgstr ""
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Email::Message::InProductMarketing::TrialShort do
let_it_be(:group) { build(:group) }
let_it_be(:user) { build(:user) }
let(:series) { 0 }
subject(:message) { described_class.new(group: group, user: user, series: series)}
describe 'public methods' do
it 'returns value for series', :aggregate_failures do
expect(message.subject_line).to eq 'Be a DevOps hero'
expect(message.tagline).to be_nil
expect(message.title).to eq 'Expand your DevOps journey with a free GitLab trial'
expect(message.subtitle).to eq 'Start your trial today to experience single application success and discover all the features of GitLab Ultimate for free!'
expect(message.body_line1).to be_empty
expect(message.body_line2).to be_empty
expect(message.cta_text).to eq 'Start a trial'
expect(message.logo_path).to eq 'mailers/in_product_marketing/trial-0.png'
end
describe '#progress' do
subject { message.progress }
before do
allow(Gitlab).to receive(:com?).and_return(is_gitlab_com)
end
context 'on gitlab.com' do
let(:is_gitlab_com) { true }
it { is_expected.to eq('This is email 1 of 4 in the Trial series.') }
end
context 'not on gitlab.com' do
let(:is_gitlab_com) { false }
it { is_expected.to include('This is email 1 of 4 in the Trial series', Gitlab::Routing.url_helpers.profile_notifications_url) }
end
end
end
end
......@@ -23,6 +23,26 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Trial do
expect(message.body_line2).to be_present
expect(message.cta_text).to be_present
end
describe '#progress' do
subject { message.progress }
before do
allow(Gitlab).to receive(:com?).and_return(is_gitlab_com)
end
context 'on gitlab.com' do
let(:is_gitlab_com) { true }
it { is_expected.to eq("This is email #{series + 2} of 4 in the Trial series.") }
end
context 'not on gitlab.com' do
let(:is_gitlab_com) { false }
it { is_expected.to include("This is email #{series + 2} of 4 in the Trial series", Gitlab::Routing.url_helpers.profile_notifications_url) }
end
end
end
end
end
......@@ -1361,6 +1361,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
"in_product_marketing_email_create_2_cta_clicked" => -1,
"in_product_marketing_email_team_short_0_sent" => -1,
"in_product_marketing_email_team_short_0_cta_clicked" => -1,
"in_product_marketing_email_trial_short_0_sent" => -1,
"in_product_marketing_email_trial_short_0_cta_clicked" => -1,
"in_product_marketing_email_verify_0_sent" => -1,
"in_product_marketing_email_verify_0_cta_clicked" => -1,
"in_product_marketing_email_verify_1_sent" => -1,
......@@ -1402,6 +1404,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
"in_product_marketing_email_create_2_cta_clicked" => 0,
"in_product_marketing_email_team_short_0_sent" => 0,
"in_product_marketing_email_team_short_0_cta_clicked" => 0,
"in_product_marketing_email_trial_short_0_sent" => 0,
"in_product_marketing_email_trial_short_0_cta_clicked" => 0,
"in_product_marketing_email_verify_0_sent" => 1,
"in_product_marketing_email_verify_0_cta_clicked" => 0,
"in_product_marketing_email_verify_1_sent" => 0,
......
......@@ -39,20 +39,21 @@ RSpec.describe Namespaces::InProductMarketingEmailsService, '#execute' do
using RSpec::Parameterized::TableSyntax
where(:track, :interval, :actions_completed) do
:create | 1 | { created_at: frozen_time - 2.days }
:create | 5 | { created_at: frozen_time - 6.days }
:create | 10 | { created_at: frozen_time - 11.days }
:team_short | 1 | { created_at: frozen_time - 2.days, git_write_at: frozen_time - 2.days }
:verify | 2 | { created_at: frozen_time - 3.days, git_write_at: frozen_time - 3.days }
:verify | 6 | { created_at: frozen_time - 7.days, git_write_at: frozen_time - 7.days }
:verify | 11 | { created_at: frozen_time - 12.days, git_write_at: frozen_time - 12.days }
:trial | 1 | { created_at: frozen_time - 2.days, git_write_at: frozen_time - 2.days, pipeline_created_at: frozen_time - 2.days }
:trial | 5 | { created_at: frozen_time - 6.days, git_write_at: frozen_time - 6.days, pipeline_created_at: frozen_time - 6.days }
:trial | 10 | { created_at: frozen_time - 11.days, git_write_at: frozen_time - 11.days, pipeline_created_at: frozen_time - 11.days }
:team | 1 | { created_at: frozen_time - 2.days, git_write_at: frozen_time - 2.days, pipeline_created_at: frozen_time - 2.days, trial_started_at: frozen_time - 2.days }
:team | 5 | { created_at: frozen_time - 6.days, git_write_at: frozen_time - 6.days, pipeline_created_at: frozen_time - 6.days, trial_started_at: frozen_time - 6.days }
:team | 10 | { created_at: frozen_time - 11.days, git_write_at: frozen_time - 11.days, pipeline_created_at: frozen_time - 11.days, trial_started_at: frozen_time - 11.days }
:experience | 30 | { created_at: frozen_time - 31.days, git_write_at: frozen_time - 31.days }
:create | 1 | { created_at: frozen_time - 2.days }
:create | 5 | { created_at: frozen_time - 6.days }
:create | 10 | { created_at: frozen_time - 11.days }
:team_short | 1 | { created_at: frozen_time - 2.days, git_write_at: frozen_time - 2.days }
:trial_short | 2 | { created_at: frozen_time - 3.days, git_write_at: frozen_time - 3.days }
:verify | 3 | { created_at: frozen_time - 4.days, git_write_at: frozen_time - 4.days }
:verify | 7 | { created_at: frozen_time - 8.days, git_write_at: frozen_time - 8.days }
:verify | 12 | { created_at: frozen_time - 13.days, git_write_at: frozen_time - 13.days }
:trial | 1 | { created_at: frozen_time - 2.days, git_write_at: frozen_time - 2.days, pipeline_created_at: frozen_time - 2.days }
:trial | 5 | { created_at: frozen_time - 6.days, git_write_at: frozen_time - 6.days, pipeline_created_at: frozen_time - 6.days }
:trial | 10 | { created_at: frozen_time - 11.days, git_write_at: frozen_time - 11.days, pipeline_created_at: frozen_time - 11.days }
:team | 1 | { created_at: frozen_time - 2.days, git_write_at: frozen_time - 2.days, pipeline_created_at: frozen_time - 2.days, trial_started_at: frozen_time - 2.days }
:team | 5 | { created_at: frozen_time - 6.days, git_write_at: frozen_time - 6.days, pipeline_created_at: frozen_time - 6.days, trial_started_at: frozen_time - 6.days }
:team | 10 | { created_at: frozen_time - 11.days, git_write_at: frozen_time - 11.days, pipeline_created_at: frozen_time - 11.days, trial_started_at: frozen_time - 11.days }
:experience | 30 | { created_at: frozen_time - 31.days, git_write_at: frozen_time - 31.days }
end
with_them do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment