use of password.pwm.util.queue.SmsQueueManager in project pwm by pwm-project.
the class PwmApplication method sendSmsUsingQueue.
public void sendSmsUsingQueue(final String to, final String message, final SessionLabel sessionLabel, final MacroMachine macroMachine) {
final SmsQueueManager smsQueue = getSmsQueue();
if (smsQueue == null) {
LOGGER.error(sessionLabel, "SMS queue is unavailable, unable to send SMS to: " + to);
return;
}
final SmsItemBean smsItemBean = new SmsItemBean(macroMachine.expandMacros(to), macroMachine.expandMacros(message), sessionLabel);
try {
smsQueue.addSmsToQueue(smsItemBean);
} catch (PwmUnrecoverableException e) {
LOGGER.warn("unable to add sms to queue: " + e.getMessage());
}
}
Aggregations