chore: Update account deletion email copy (#12317)
Update the email copies for account deletion emails ## Manual Deletion <img width="1378" height="678" alt="Screenshot 2025-08-29 at 2 41 40 PM" src="https://github.com/user-attachments/assets/63d7ad97-ad51-4a8b-9ef3-d427fa467f8a" /> ## Inactive Deletion <img width="2946" height="1808" alt="image" src="https://github.com/user-attachments/assets/bb50d08c-8701-4f93-af29-0b1d948a4009" /> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
class AdministratorNotifications::AccountNotificationMailer < AdministratorNotifications::BaseMailer
|
||||
def account_deletion(account, reason = 'manual_deletion')
|
||||
subject = 'Your account has been marked for deletion'
|
||||
def account_deletion_user_initiated(account, reason)
|
||||
subject = 'Your Chatwoot account deletion has been scheduled'
|
||||
action_url = settings_url('general')
|
||||
meta = {
|
||||
'account_name' => account.name,
|
||||
'deletion_date' => account.custom_attributes['marked_for_deletion_at'],
|
||||
'deletion_date' => format_deletion_date(account.custom_attributes['marked_for_deletion_at']),
|
||||
'reason' => reason
|
||||
}
|
||||
|
||||
send_notification(subject, action_url: action_url, meta: meta)
|
||||
end
|
||||
|
||||
def account_deletion_for_inactivity(account, reason)
|
||||
subject = 'Your Chatwoot account is scheduled for deletion due to inactivity'
|
||||
action_url = settings_url('general')
|
||||
meta = {
|
||||
'account_name' => account.name,
|
||||
'deletion_date' => format_deletion_date(account.custom_attributes['marked_for_deletion_at']),
|
||||
'reason' => reason
|
||||
}
|
||||
|
||||
@@ -45,4 +57,14 @@ class AdministratorNotifications::AccountNotificationMailer < AdministratorNotif
|
||||
|
||||
send_notification(subject, action_url: action_url, meta: meta)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def format_deletion_date(deletion_date_str)
|
||||
return 'Unknown' if deletion_date_str.blank?
|
||||
|
||||
Time.zone.parse(deletion_date_str).strftime('%B %d, %Y')
|
||||
rescue StandardError
|
||||
'Unknown'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<p>Hello,</p>
|
||||
|
||||
<p>Your account <strong>{{ meta.account_name }}</strong> has been marked for deletion. The account will be permanently deleted on <strong>{{ meta.deletion_date }}</strong>.</p>
|
||||
|
||||
{% if meta.reason == 'manual_deletion' %}
|
||||
<p>This action was requested by one of the administrators of your account.</p>
|
||||
{% else %}
|
||||
<p>Reason for deletion: {{ meta.reason }}</p>
|
||||
{% endif %}
|
||||
|
||||
<p>If this was done in error, you can cancel the deletion process by visiting your account settings.</p>
|
||||
|
||||
<p><a href="{{ action_url }}">Cancel Account Deletion</a></p>
|
||||
|
||||
<p>Thank you,<br>
|
||||
Team Chatwoot</p>
|
||||
@@ -0,0 +1,21 @@
|
||||
<p>Hello there,</p>
|
||||
|
||||
<p>We've noticed that your Chatwoot account <strong>{{ meta.account_name }}</strong> has been inactive for some time. Because of this, it's scheduled for deletion on <strong>{{ meta.deletion_date }}</strong>.</p>
|
||||
|
||||
<p><strong>How do I keep my account?</strong></p>
|
||||
|
||||
<p>Log in to your Chatwoot account before <strong>{{ meta.deletion_date }}</strong>. From your account settings, you can <a href="{{ action_url }}">cancel the deletion</a> and continue using your account.</p>
|
||||
|
||||
<p><strong>What happens if I don't cancel?</strong></p>
|
||||
|
||||
<p>Unless you cancel the account deletion before <strong>{{ meta.deletion_date }}</strong>, your account and all associated data — including conversations, contacts, reports, and settings — will be permanently deleted.</p>
|
||||
|
||||
<p><strong>Why are we doing this?</strong></p>
|
||||
|
||||
<p>To keep things secure and efficient, we regularly remove inactive accounts so our systems remain optimized for active teams.</p>
|
||||
|
||||
<p>If you have any questions, feel free to reach us at <a href="mailto:hello@chatwoot.com">hello@chatwoot.com</a>.</p>
|
||||
|
||||
<p>— The Chatwoot Team</p>
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<p>Hello there,</p>
|
||||
|
||||
<p>An account administrator has requested deletion of the Chatwoot account <strong>{{ meta.account_name }}</strong>. The account is scheduled for deletion on <strong>{{ meta.deletion_date }}</strong>.</p>
|
||||
|
||||
<p><strong>What happens next?</strong></p>
|
||||
|
||||
<ul>
|
||||
<li>The account will remain accessible until the scheduled deletion date.</li>
|
||||
<li>After that, all data including conversations, contacts, integrations, and settings will be permanently removed.</li>
|
||||
</ul>
|
||||
|
||||
<p>If you change your mind before the deletion date, you can <a href="{{ action_url }}">cancel this request</a> by visiting your account settings.</p>
|
||||
|
||||
<p>— The Chatwoot Team</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user