mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
client and some admin new
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -161,6 +161,38 @@ const emailTemplates = {
|
||||
<p>For security, please do not share your credentials with anyone. If you need a new password, contact your administrator.</p>
|
||||
`),
|
||||
}),
|
||||
|
||||
TIER_ACCESS_REVOKED: ({ name, label, date }) => ({
|
||||
subject: "Your Subscription Access Has Been Revoked - STARR System",
|
||||
html: wrap(`
|
||||
<p>Dear ${name},</p>
|
||||
<p>We're writing to inform you that your access under the following subscription plan has been revoked by our team, effective <strong>${date}</strong>:</p>
|
||||
<table style="${FONT}">
|
||||
<tr><td><strong>Plan</strong></td><td>${label}</td></tr>
|
||||
<tr><td><strong>Status</strong></td><td>Access Revoked</td></tr>
|
||||
<tr><td><strong>Refund</strong></td><td>Not applicable — this subscription is non-refundable</td></tr>
|
||||
</table>
|
||||
<p>Your account no longer has access to the courses, units, and lessons included in this plan. If you were not concurrently subscribed to another active plan, your account has reverted to the Free tier.</p>
|
||||
<p>If you believe this was done in error or have questions about this change, please contact our support team.</p>
|
||||
`),
|
||||
}),
|
||||
|
||||
REFUND_PROCESSED: ({ name, label, amount, currency, date, refundId }) => ({
|
||||
subject: "Your Refund Has Been Processed - STARR System",
|
||||
html: wrap(`
|
||||
<p>Dear ${name},</p>
|
||||
<p>We're writing to confirm that your refund request has been processed as of <strong>${date}</strong>:</p>
|
||||
<table style="${FONT}">
|
||||
<tr><td><strong>Plan</strong></td><td>${label}</td></tr>
|
||||
<tr><td><strong>Amount Refunded</strong></td><td>${currency} ${amount}</td></tr>
|
||||
<tr><td><strong>Refund ID</strong></td><td>${refundId}</td></tr>
|
||||
<tr><td><strong>Status</strong></td><td>Refunded</td></tr>
|
||||
</table>
|
||||
<p>Your access to the courses, units, and lessons included in this plan has been revoked effective immediately. If you were not concurrently subscribed to another active plan, your account has reverted to the Free tier.</p>
|
||||
<p>Please allow a few business days for the refunded amount to reflect on your original payment method, depending on your provider.</p>
|
||||
<p>If you have any questions about this refund, please contact our support team.</p>
|
||||
`),
|
||||
}),
|
||||
};
|
||||
|
||||
module.exports = { emailTemplates };
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* User : task_requirements_updated, task_submissions_closed, task_submissions_reopened, user_task_overdue, user_task_auto_completed, task_reminder, achievement,
|
||||
* course_unlocked, course_completed, certificate_issued, welcome,
|
||||
* nogrp_welcome, assessment_updated, announcement, tier_expired,
|
||||
* tier_plan_archived,
|
||||
* tier_plan_archived, tier_plan_access_revoked, payment_refunded,
|
||||
* task_submission_reviewed, task_assigned, task_completed
|
||||
* Both : broadcast (admin-composed, sent via notification_broadcasts CRUD)
|
||||
*
|
||||
@@ -393,6 +393,40 @@ const NOTIFICATION_REGISTRY = {
|
||||
},
|
||||
},
|
||||
|
||||
// Distinct from tier_plan_archived above — that one explicitly says access
|
||||
// is unaffected, which would be false here, so an admin force-revoke
|
||||
// always fires THIS instead of (never alongside) tier_plan_archived.
|
||||
tier_plan_access_revoked: {
|
||||
type: 'tier_plan_access_revoked',
|
||||
scope: 'user',
|
||||
trigger: 'event',
|
||||
build({ label, planId = null }) {
|
||||
return {
|
||||
type: 'tier_plan_access_revoked',
|
||||
title: 'Subscription Access Revoked',
|
||||
message: `Your access under the "${label}" plan has been revoked by an administrator, effective immediately. This subscription is non-refundable.`,
|
||||
data: { label, planId },
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
// Fired when a user self-serves a refund within their plan's refund window
|
||||
// (controllers/client/tiers.controller.js refundOrder) — distinct from
|
||||
// tier_plan_access_revoked above, which is an admin-initiated, non-refundable cutoff.
|
||||
payment_refunded: {
|
||||
type: 'payment_refunded',
|
||||
scope: 'user',
|
||||
trigger: 'event',
|
||||
build({ label, amount, currency, planId = null }) {
|
||||
return {
|
||||
type: 'payment_refunded',
|
||||
title: 'Refund Processed',
|
||||
message: `Your refund of ${currency} ${amount} for the "${label}" plan has been processed. Your access to this plan has been revoked.`,
|
||||
data: { label, amount, currency, planId },
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
module.exports = { NOTIFICATION_REGISTRY };
|
||||
|
||||
Reference in New Issue
Block a user