feat: Enhance CMS Microservice with SystemConstants and SmsTemplates
- Added SystemConstants class to centralize hardcoded values for club configuration, commission configuration, and package amounts. - Introduced SmsTemplates class to manage SMS message templates for various user notifications. - Implemented automatic SMS sending for Daya Loan approval notifications. - Updated BackOffice UI to include App Version management features. - Fixed mapping issues in Mapster profiles for improved data handling. - Updated changelog and documentation to reflect recent changes and configurations.
This commit is contained in:
@@ -1,5 +1,65 @@
|
||||
# راهنمای پیکربندی Email و SMS
|
||||
|
||||
## قالبهای پیامک (SmsTemplates)
|
||||
|
||||
> **فایل**: `CMSMicroservice.Domain/Common/SmsTemplates.cs`
|
||||
|
||||
همه قالبهای پیامک در یک کلاس متمرکز شدهاند:
|
||||
|
||||
```csharp
|
||||
public static class SmsTemplates
|
||||
{
|
||||
// وام دایا
|
||||
public static string DayaLoanReceived(string? firstName, long amount)
|
||||
=> $"{GetUserName(firstName)} عزیز، مبلغ {amount:N0} ریال وام دایا به کیف پول شما واریز شد. کارابازار";
|
||||
|
||||
// فعالسازی باشگاه
|
||||
public static string ClubActivated(string? firstName)
|
||||
=> $"{GetUserName(firstName)} عزیز، حساب باشگاه شما فعال شد. کارابازار";
|
||||
|
||||
// خرید پکیج
|
||||
public static string PackagePurchased(string? firstName, string packageName)
|
||||
=> $"{GetUserName(firstName)} عزیز، پکیج {packageName} با موفقیت خریداری شد. کارابازار";
|
||||
|
||||
// واریز کمیسیون
|
||||
public static string CommissionDeposited(string? firstName, long amount)
|
||||
=> $"{GetUserName(firstName)} عزیز، مبلغ {amount:N0} ریال کمیسیون به کیف پول شما واریز شد. کارابازار";
|
||||
|
||||
// برداشت موفق
|
||||
public static string WithdrawalSuccess(string? firstName, long amount)
|
||||
=> $"{GetUserName(firstName)} عزیز، درخواست برداشت {amount:N0} ریال با موفقیت انجام شد. کارابازار";
|
||||
|
||||
// پیوستن به شبکه
|
||||
public static string NetworkJoined(string? firstName, string referrerName)
|
||||
=> $"{GetUserName(firstName)} عزیز، به شبکه {referrerName} پیوستید. کارابازار";
|
||||
|
||||
// زیرمجموعه جدید
|
||||
public static string NewDownline(string? firstName, string newMemberName)
|
||||
=> $"{GetUserName(firstName)} عزیز، {newMemberName} به زیرمجموعه شما اضافه شد. کارابازار";
|
||||
|
||||
// کد OTP
|
||||
public static string OtpCode(string code)
|
||||
=> $"کد تأیید شما: {code}\nکارابازار";
|
||||
|
||||
// خوشآمدگویی
|
||||
public static string Welcome(string? firstName)
|
||||
=> $"{GetUserName(firstName)} عزیز، به کارابازار خوش آمدید!";
|
||||
}
|
||||
```
|
||||
|
||||
### نحوه استفاده:
|
||||
|
||||
```csharp
|
||||
// تزریق سرویس
|
||||
private readonly IKavenegarService _smsService;
|
||||
|
||||
// ارسال پیامک
|
||||
var message = SmsTemplates.DayaLoanReceived(user.FirstName, 56_000_000);
|
||||
await _smsService.SendAsync(user.PhoneNumber, message);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## تنظیمات Email (Gmail)
|
||||
|
||||
### مرحله 1: ایجاد App Password در Gmail
|
||||
|
||||
Reference in New Issue
Block a user