2025-08-13 14:25:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
class UsersMailer < ApplicationMailer
|
|
|
|
|
def welcome
|
2025-09-13 09:37:09 -04:00
|
|
|
# Sent after user signs up
|
2025-08-13 14:25:48 -04:00
|
|
|
@user = params[:user]
|
|
|
|
|
|
2025-08-19 12:31:37 -04:00
|
|
|
mail(to: @user.email, subject: 'Welcome to Dawarich!')
|
2025-08-13 14:25:48 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def explore_features
|
2025-09-13 09:37:09 -04:00
|
|
|
# Sent 2 days after user signs up
|
2025-08-13 14:25:48 -04:00
|
|
|
@user = params[:user]
|
|
|
|
|
|
2025-08-19 12:31:37 -04:00
|
|
|
mail(to: @user.email, subject: 'Explore Dawarich features!')
|
2025-08-13 14:25:48 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def trial_expires_soon
|
2025-09-13 09:37:09 -04:00
|
|
|
# Sent 2 days before trial expires
|
2025-08-13 14:25:48 -04:00
|
|
|
@user = params[:user]
|
|
|
|
|
|
2025-08-19 12:31:37 -04:00
|
|
|
mail(to: @user.email, subject: '⚠️ Your Dawarich trial expires in 2 days')
|
2025-08-13 14:25:48 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def trial_expired
|
2025-09-13 09:37:09 -04:00
|
|
|
# Sent when trial expires
|
2025-08-13 14:25:48 -04:00
|
|
|
@user = params[:user]
|
|
|
|
|
|
2025-08-19 12:31:37 -04:00
|
|
|
mail(to: @user.email, subject: '💔 Your Dawarich trial expired')
|
2025-08-13 14:25:48 -04:00
|
|
|
end
|
2025-09-05 13:39:50 -04:00
|
|
|
|
|
|
|
|
def post_trial_reminder_early
|
2025-09-13 09:37:09 -04:00
|
|
|
# Sent 2 days after trial expires
|
2025-09-05 13:39:50 -04:00
|
|
|
@user = params[:user]
|
|
|
|
|
|
|
|
|
|
mail(to: @user.email, subject: '🚀 Still interested in Dawarich? Subscribe now!')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def post_trial_reminder_late
|
2025-09-13 09:37:09 -04:00
|
|
|
# Sent 7 days after trial expires
|
2025-09-05 13:39:50 -04:00
|
|
|
@user = params[:user]
|
|
|
|
|
|
|
|
|
|
mail(to: @user.email, subject: '📍 Your location data is waiting - Subscribe to Dawarich')
|
|
|
|
|
end
|
2025-08-13 14:25:48 -04:00
|
|
|
end
|