/
drip_new_signup_enterprise.go
186 lines (157 loc) · 7.87 KB
/
drip_new_signup_enterprise.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/*
Copyright AppsCode Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package server
import (
"time"
"gomodules.xyz/mailer"
timex "gomodules.xyz/x/time"
"google.golang.org/api/sheets/v4"
)
type SignupCampaignData struct {
Name string
Cluster string
Product string
ProductDisplayName string
IsEnterpriseProduct bool
TwitterHandle string
QuickstartLink string
}
func NewEnterpriseSignupCampaign(srv *sheets.Service, mg *mailer.SMTPService) *mailer.DripCampaign {
return &mailer.DripCampaign{
Name: "New Signup",
Steps: append([]mailer.CampaignStep{
{
WaitTime: 0,
WeekendAdjustment: timex.NoChange,
Mailer: mailer.Mailer{
Sender: MailHello,
BCC: MailLicenseTracker,
ReplyTo: MailHello,
Subject: "Welcome to AppsCode",
Body: `Hi {{.Name}},
Thanks for trying {{.ProductDisplayName}}. We hope our products can make your life a little easier. Here is a complete guide {{.QuickstartLink}} to make sure you are set up for success with {{.ProductDisplayName}}.
{{ if not .IsEnterpriseProduct }}
We noticed that you are trying the Community Edition. We offer a 30 day FREE evaluation license for our {{.ProductDisplayName}} Enterprise product. The Enterprise version offers important features for Day-2 operations.
{{ end }}
We look forward to hearing from you.
Warm Regards,
Team AppsCode
[![Website](https://cdn.appscode.com/images/website.png)](https://appscode.com) [![Linkedin](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/ln.png)](https://www.linkedin.com/company/appscode/) [![Twitter](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/tt.png)](https://twitter.com/AppsCodeHQ) [![Youtube](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/yt.png)](https://www.youtube.com/c/AppsCodeInc)
`,
Params: nil,
AttachmentBytes: nil,
GDriveFiles: nil,
GoogleDocIds: nil,
},
},
{
WaitTime: 1 * 24 * time.Hour, // 1 day
WeekendAdjustment: timex.After,
Mailer: mailer.Mailer{
Sender: MailHello,
BCC: MailLicenseTracker,
ReplyTo: MailHello,
Subject: "How is it going with {{.ProductDisplayName}}?",
Body: `Hi {{.Name}},
I hope you are doing well. Just wanted to check your progress with {{.ProductDisplayName}} so far. We want to make sure your journey with {{.ProductDisplayName}} is going smoothly so far.
For support, please mail us at support@appscode.com. Our engineers are happy to help you during the evaluation period.
Warm Regards,
Team AppsCode
[![Website](https://cdn.appscode.com/images/website.png)](https://appscode.com) [![Linkedin](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/ln.png)](https://www.linkedin.com/company/appscode/) [![Twitter](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/tt.png)](https://twitter.com/AppsCodeHQ) [![Youtube](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/yt.png)](https://www.youtube.com/c/AppsCodeInc)
`,
Params: nil,
AttachmentBytes: nil,
GDriveFiles: nil,
GoogleDocIds: nil,
},
},
{
WaitTime: 5 * 24 * time.Hour, // 5 days
WeekendAdjustment: timex.After,
Mailer: mailer.Mailer{
Sender: MailHello,
BCC: MailLicenseTracker,
ReplyTo: MailHello,
Subject: "Keeping Up With {{.ProductDisplayName}}",
Body: `Hi {{.Name}},
Thanks again for trying {{.ProductDisplayName}}. Did you know we have a [LinkedIn](https://www.linkedin.com/company/appscode/) and [Twitter](https://twitter.com/{{.TwitterHandle}}) handle? Connect with us to be up to date with AppsCode. You can also subscribe to our [YouTube](https://www.youtube.com/c/appscodeinc) channel.
Warm Regards,
Team AppsCode
[![Website](https://cdn.appscode.com/images/website.png)](https://appscode.com) [![Linkedin](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/ln.png)](https://www.linkedin.com/company/appscode/) [![Twitter](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/tt.png)](https://twitter.com/AppsCodeHQ) [![Youtube](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/yt.png)](https://www.youtube.com/c/AppsCodeInc)
`,
Params: nil,
AttachmentBytes: nil,
GDriveFiles: nil,
GoogleDocIds: nil,
},
},
}, NewEnterpriseFirstTimeCampaign(srv, mg).Steps...),
M: mg,
SheetService: srv,
SpreadsheetId: DripSpreadsheetId,
SheetName: "NEW_SIGNUP_ENTERPRISE",
}
}
func NewEnterpriseFirstTimeCampaign(srv *sheets.Service, mg *mailer.SMTPService) *mailer.DripCampaign {
return &mailer.DripCampaign{
Name: "New Signup",
Steps: []mailer.CampaignStep{
{
WaitTime: 23 * 24 * time.Hour, // 23 days
WeekendAdjustment: timex.After,
Mailer: mailer.Mailer{
Sender: MailHello,
BCC: MailLicenseTracker,
ReplyTo: MailHello,
Subject: "Your {{.ProductDisplayName}} trial for cluster {{.Cluster}} ending soon",
Body: `Hi {{.Name}},
You are almost at the end of your trial period for {{.Product}}. Would you like to extend your trial? Or maybe you would like to get a full Enterprise license? For an Enterprise price quote, please reach us [here](https://appscode.com/contact/).
Or you can also email us at sales@appscode.com.
Warm Regards,
Team AppsCode
[![Website](https://cdn.appscode.com/images/website.png)](https://appscode.com) [![Linkedin](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/ln.png)](https://www.linkedin.com/company/appscode/) [![Twitter](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/tt.png)](https://twitter.com/AppsCodeHQ) [![Youtube](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/yt.png)](https://www.youtube.com/c/AppsCodeInc)
`,
Params: nil,
AttachmentBytes: nil,
GDriveFiles: nil,
GoogleDocIds: nil,
},
},
{
WaitTime: 30 * 24 * time.Hour, // 30 days
WeekendAdjustment: timex.After,
Mailer: mailer.Mailer{
Sender: MailHello,
BCC: MailLicenseTracker,
ReplyTo: MailHello,
Subject: "{{.ProductDisplayName}} next steps",
Body: `Hi {{.Name}},
Congratulations on reaching the end of your trial period with {{.ProductDisplayName}} for cluster {{.Cluster}}. Here on, we would love to hear about your journey with our product. And how would you like to move forward with us? For an Enterprise price quote, please reach us [here](https://appscode.com/contact/).
Or email us at sales@appscode.com.
Warm Regards,
Team AppsCode
[![Website](https://cdn.appscode.com/images/website.png)](https://appscode.com) [![Linkedin](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/ln.png)](https://www.linkedin.com/company/appscode/) [![Twitter](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/tt.png)](https://twitter.com/AppsCodeHQ) [![Youtube](https://codetwocdn.azureedge.net/images/mail-signatures/generator-dm/pad-box/yt.png)](https://www.youtube.com/c/AppsCodeInc)
`,
Params: nil,
AttachmentBytes: nil,
GDriveFiles: nil,
GoogleDocIds: nil,
},
},
},
M: mg,
SheetService: srv,
SpreadsheetId: DripSpreadsheetId,
SheetName: "FIRST_TIME_ENTERPRISE",
}
}