feat: send account and invoice SMS from stored template IDs

Move sms.ir template IDs out of env into settings so SuperAdmin can manage them, and record every outbound SMS status in notifications.
This commit is contained in:
2026-08-15 18:37:44 +03:30
parent 23edffba6a
commit 3160f07873
13 changed files with 261 additions and 22 deletions
+9 -1
View File
@@ -12,11 +12,19 @@ const toBoolean = (value) => {
return ['true', '1', 'yes', 'on'].includes(normalized);
};
const redactSmsParams = (params = []) => (
params.map((param) => (
String(param?.name || '').toLowerCase() === 'password'
? { ...param, value: '[redacted]' }
: param
))
);
const sendSingleSms = async (mobile, templateId, params = []) => {
console.log('[SMS] About to send notification:', {
mobile,
templateId,
params,
params: redactSmsParams(params),
SMS_ENABLED: config.SMS_ENABLED,
});