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:
@@ -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,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user