Search in sources :

Example 1 with SmsQueueManager

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());
    }
}
Also used : SmsQueueManager(password.pwm.util.queue.SmsQueueManager) SmsItemBean(password.pwm.bean.SmsItemBean) PwmUnrecoverableException(password.pwm.error.PwmUnrecoverableException)

Aggregations

SmsItemBean (password.pwm.bean.SmsItemBean)1 PwmUnrecoverableException (password.pwm.error.PwmUnrecoverableException)1 SmsQueueManager (password.pwm.util.queue.SmsQueueManager)1