Hello {{name}},
-
Thank you for using textbee.dev! We hope you're enjoying our service
- so far.
+
Thank you for using textbee.dev! We're excited to see that you've been using our platform with {{deviceCount}} connected device{{#if deviceCount > 1}}s{{/if}}.
-
We wanted to let you know that you're currently on our
- Free Plan, which provides basic functionality. To
- unlock the full potential of textbee.dev, consider upgrading to our
- Pro Plan.
+
Many of our users have found that upgrading to Pro helps them scale their SMS capabilities more effectively as they grow. Here's what you can unlock:
-
Special Offer Just For You:
- We're extending a
- 30% discount
- on all Pro plans exclusively for our most active users like you! This
- offer is only available for a limited time.
-
-
Plan Comparison:
-
-
-
- | Feature |
- Free Plan |
- Pro Plan |
-
-
- | Daily Message Limit |
- 50 |
- Unlimited |
-
-
- | Monthly Recipient Limit |
- 500 |
- 5,000 |
-
-
- | Device Limit |
- 1 |
- Unlimited |
-
-
- | Bulk SMS Recipients |
- 50 |
- Unlimited |
-
-
- | Support |
- Basic |
- Priority |
-
+
+
✓
+
+
Unlimited Daily Messages
+
Remove the 50-message daily limit and scale your SMS communications as needed
+
+
+
+
+
✓
+
+
Connect Multiple Devices
+
+ Connect multiple devices to your account to increase your SMS sending capacity.
+
+
+
+
+
+
✓
+
+
Priority Support
+
Get faster responses and dedicated assistance for your integration questions
+
+
+
+
+ "textbee.dev Pro has been game-changing for our delivery notifications. We've seen a 28% increase in customer satisfaction since implementing automated SMS updates."
+
- Sarah K., E-commerce Business Owner
+
-
+
As a valued user, we're offering you a special 30% discount if you upgrade in the next 7 days:
-
-
Pro
- Plan Pricing
-
-
-
Monthly
-
$9.99
- $6.99
-
30% off -
- limited time
-
-
-
Annual
-
$99.99
- $69.99
-
30% off -
- limited time
-
+
+
+
Monthly
+
$9.99/mo
+
$6.99/mo
+
30% savings
+
+
+
+
Annual
+
$99.99/yr
+
$69.99/yr
+
Save 42% vs monthly
-
If you have any questions about our plans or need assistance, please
- feel free to contact us at
- support@textbee.dev.
+
Not ready to upgrade? That's completely fine! Your free plan will continue to work as usual. If you have any questions about the Pro features or need help with your current setup, I'm happy to assist.
Best regards,
The textbee.dev Team
+
+
diff --git a/api/src/mail/templates/welcome-1.hbs b/api/src/mail/templates/welcome-1.hbs
index ba53ae3..3655abd 100644
--- a/api/src/mail/templates/welcome-1.hbs
+++ b/api/src/mail/templates/welcome-1.hbs
@@ -1,126 +1,207 @@
+
+
+
Welcome to textbee.dev
-
Hi {{name}},
-
-
It's Vernu here, creator of textbee.dev. I built this platform to help you
- with all your messaging needs - whether it's sending OTPs,
- notifications, or creating automated messaging workflows for your
- business.
-
-
+
+
+
Welcome to textbee.dev!
+
Your gateway to powerful SMS integration
+
+
+
Hi {{name}},
+
+
Welcome to textbee.dev! This platform is designed to provide simple
+ yet powerful SMS integration for developers and businesses of all
+ sizes.
+
+
+
Thank you for choosing textbee.dev. We're excited to support your
+ projects, whether you're building authentication systems for your
+ customers, notifications, or interactive workflows!
+
+
+
What You Can Build with textbee.dev
+
+
+
User Authentication
+
Implement secure two-factor authentication with SMS verification
+ codes to protect user accounts and sensitive data.
+
+
+
+
Customer Notifications
+
Send automated order updates, appointment reminders, delivery
+ status changes, and other important alerts directly to your
+ customers' phones.
+
+
+
+
Interactive Workflows
+
Create conversational experiences where users can reply to messages
+ to complete tasks, answer surveys, or trigger automated responses.
+
-
-
-
- P.S.
- I'd love to hear from you! Why did you choose TextBee? Do you have any
- feedback or questions?
- Feel free to reach out to our support team at
- contact@textbee.dev.
- We read and respond to all emails as quickly as possible.
-
-
-
-
+
Get Started in Minutes
-
+
+
diff --git a/api/src/users/users.service.ts b/api/src/users/users.service.ts
index 3c5077a..12a3d37 100644
--- a/api/src/users/users.service.ts
+++ b/api/src/users/users.service.ts
@@ -75,43 +75,42 @@ export class UsersService {
@Cron('0 12 * * *') // Every day at 12 PM
async sendEmailToInactiveNewUsers() {
try {
- // Get users who signed up between 24-48 hours ago (1-2 days ago)
- const twoDaysAgo = new Date(Date.now() - 48 * 60 * 60 * 1000)
- const oneDayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000)
+ // Get users who signed up between 3-4 days ago (not 1-2 days)
+ const fourDaysAgo = new Date(Date.now() - 4 * 24 * 60 * 60 * 1000)
+ const threeDaysAgo = new Date(Date.now() - 3 * 24 * 60 * 60 * 1000)
const newUsers = await this.userModel.find({
createdAt: {
- $gte: twoDaysAgo,
- $lt: oneDayAgo,
+ $gte: fourDaysAgo,
+ $lt: threeDaysAgo,
},
})
- const emailPromises = newUsers.map(async (user) => {
+ for (const user of newUsers) {
try {
- // Check if user has any devices registered
+ // Check if user has any devices registered or has sent/received any SMS
const devices = await this.deviceModel.find({ user: user._id })
- if (devices.length === 0) {
+ if (devices.length === 0 || devices.map(device=>device.sentSMSCount + device.receivedSMSCount).reduce((a,b)=>a+b,0) == 0) {
// User hasn't registered any device, send email
await this.mailService.sendEmailFromTemplate({
to: user.email,
subject:
- 'Get Started with textbee.dev - Register Your First Device',
+ 'Getting Started with textbee.dev - How Can We Help?',
template: 'inactive-new-user',
context: {
name: user.name,
registerDeviceUrl: `${process.env.FRONTEND_URL}/dashboard`,
},
})
-
console.log(`Sent inactive new user email to ${user.email}`)
}
+ // Wait 200ms before processing the next user
+ await new Promise((resolve) => setTimeout(resolve, 200))
} catch (error) {
console.error(`Error processing email for user ${user.email}:`, error)
}
- })
-
- await Promise.allSettled(emailPromises)
+ }
} catch (error) {
console.error('Error sending emails to inactive new users:', error)
}
@@ -120,18 +119,18 @@ export class UsersService {
@Cron('0 13 * * *') // Every day at 1 PM
async sendEmailToFreeUsers() {
try {
- // Get users who signed up between 3-4 days ago
- const threeDaysAgo = new Date(Date.now() - 3 * 24 * 60 * 60 * 1000)
- const fourDaysAgo = new Date(Date.now() - 4 * 24 * 60 * 60 * 1000)
+ // Get users who signed up between 13-14 days ago
+ const fourteenDaysAgo = new Date(Date.now() - 14 * 24 * 60 * 60 * 1000)
+ const thirteenDaysAgo = new Date(Date.now() - 13 * 24 * 60 * 60 * 1000)
const usersToEmail = await this.userModel.find({
createdAt: {
- $gte: fourDaysAgo,
- $lt: threeDaysAgo,
+ $gte: fourteenDaysAgo,
+ $lt: thirteenDaysAgo,
},
})
- const emailPromises = usersToEmail.map(async (user) => {
+ for (const user of usersToEmail) {
try {
const subscription = await this.billingService.getActiveSubscription(
user._id.toString(),
@@ -140,11 +139,12 @@ export class UsersService {
if (subscription?.plan?.name === 'free') {
const devices = await this.deviceModel.find({ user: user._id })
- if (devices.length === 0) {
+ if (devices.length === 0 || devices.map(device=>device.sentSMSCount + device.receivedSMSCount).reduce((a,b)=>a+b,0) == 0) {
+ // Only send this if they haven't set up any devices after 10-14 days
await this.mailService.sendEmailFromTemplate({
to: user.email,
- subject: `${user.name?.split(' ')[0]}, Your textbee.dev account is waiting for you!`,
- template: 'inactive-new-user-day-3',
+ subject: `${user.name?.split(' ')[0]}, we'd love to help you get started with textbee.dev`,
+ template: 'inactive-new-user-day-10',
context: {
name: user.name,
registerDeviceUrl: `${process.env.FRONTEND_URL}/dashboard`,
@@ -153,24 +153,27 @@ export class UsersService {
console.log(`Sent inactive new user email to ${user.email}`)
} else {
+ // Only send upgrade email to active users who have at least one device
await this.mailService.sendEmailFromTemplate({
to: user.email,
- subject: `${user.name?.split(' ')[0]}, Upgrade to Pro with a 30% Discount - textbee.dev`,
+ subject: `${user.name?.split(' ')[0]}, unlock more capabilities with textbee.dev Pro`,
template: 'upgrade-to-pro',
context: {
name: user.name,
upgradeUrl: `${process.env.FRONTEND_URL}/checkout/pro`,
+ deviceCount: devices.length,
},
})
console.log(`Sent upgrade to pro email to ${user.email}`)
}
}
+
+ // Wait 200ms before processing the next user
+ await new Promise((resolve) => setTimeout(resolve, 200))
} catch (error) {
console.error(`Error processing email for user ${user.email}:`, error)
}
- })
-
- await Promise.allSettled(emailPromises)
+ }
} catch (error) {
console.error('Error sending emails to free plan users:', error)
}