@using BTCPayServer.Client @using BTCPayServer.Plugins.Emails @using BTCPayServer.Plugins.Subscriptions @using BTCPayServer.Plugins.Subscriptions.Controllers @using BTCPayServer.Services @model SubscriptionsViewModel @inject DisplayFormatter DisplayFormatter @inject BTCPayServer.Security.ContentSecurityPolicies Csp @{ string storeId = (string)this.Context.GetRouteValue("storeId"); string offeringId = (string)this.Context.GetRouteValue("offeringId"); ViewData.SetLayoutModel(new LayoutModel($"{nameof(SubscriptionsPlugin)}-{offeringId}", StringLocalizer["Subscriptions"])); Csp.UnsafeEval(); } @section PageHeadContent { }
Active Subscribers

@Model.TotalSubscribers

Monthly revenue

@Model.TotalMonthlyRevenue

@if (Model.Section == SubscriptionSection.Plans) {

Plans

Add Plan
@if (Model.Plans.Count != 0) { foreach (var p in Model.Plans) { } } else { }
Plan API ID Price Recurring Grace Period Trial Period Status Active Members Actions
@DisplayFormatter.Currency(@p.Data.Price, @p.Data.Currency, DisplayFormatter.CurrencyFormat.CodeAndSymbol) @p.Data.RecurringType @p.Data.GracePeriodDays days @p.Data.TrialDays days @{ var (badge, name) = p.Data.Status switch { PlanData.PlanStatus.Retired => p.Data.MemberCount != 0 ? ("warning", StringLocalizer["Retiring"]) : ("danger", StringLocalizer["Retired"]), _ => ("success", StringLocalizer["Active"]) }; } @name @p.Data.MemberCount Members
There are no subscription plans.
} else if (Model.Section == SubscriptionSection.Subscribers) {

Subscribers

@if (Model.SelectablePlans.Count != 0) { Add subscriber }
@if (Model.Subscribers.Count != 0) { @foreach (var subscriber in Model.Subscribers) { } if (Model.TooMuchSubscribers) { } } else { }
User Credits Plan Phase Status Actions
@if (subscriber.Data.TestAccount) { Test }
@subscriber.Data.Plan.Name @{ var (style, name) = subscriber.Data.Phase switch { SubscriberData.PhaseTypes.Normal => ("success", StringLocalizer["Normal"]), SubscriberData.PhaseTypes.Expired => ("danger", StringLocalizer["Expired"]), SubscriberData.PhaseTypes.Grace => ("warning", StringLocalizer["Grace"]), SubscriberData.PhaseTypes.Trial => ("info", StringLocalizer["Trial"]), _ => throw new NotSupportedException() }; } @name
There are many subscribers, use search to look for them.
There are no subscribers.
} else if (Model.Section == SubscriptionSection.Mails) {

Mails

@if (!Model.EmailConfigured) {
Email Configuration

No email address has been configured for the Server. Configure an email address to begin sending emails.

Configure email
}
Notifications & Alerts
days
Email rules
@if (Model.EmailRules.Count == 0) { } else { @foreach (var rule in Model.EmailRules) { var thisPage = @Url.Action(nameof(UIOfferingController.Offering), new { storeId, offeringId, SubscriptionSection.Mails }); } }
Trigger Subject
There are no email rules for this offering.
@rule.TriggerViewModel.Description @rule.Data.Subject
}
@section PageFootContent { }