public final class SmsEvents

MotechEvent Helper class, builds events from provided parameters.



public static MotechEvent inboundEvent(String config, String sender, String recipient, String message, String providerMessageId, DateTime timestamp)

Creates an event which should be published after receiving an inbound SMS.

  • config – the configuration which received the SMS
  • sender – the sender number
  • recipient – the recipient number
  • message – the content of the SMS messages
  • providerMessageId – the provider ID of the message
  • timestamp – the message timestamp

a MotechEvent that will indicate an inbound SMS


public static MotechEvent outboundEvent(String subject, String config, List<String> recipients, String message, String motechId, String providerMessageId, Integer failureCount, String providerStatus, DateTime timestamp, Map<String, String> customParams)

Creates an MOTECH event which will describe an outbound SMS (already sent or to be sent).

  • subject – the subject of the evnet
  • config – the configuration which
  • recipients – the recipient numbers for the SMS
  • message – the SMS message
  • motechId – the MOTECH ID of the message
  • providerMessageId – the provider ID of the message
  • failureCount – the failure counter for this message, will be used for retries
  • providerStatus – the SMS status coming from the provider
  • timestamp – the timestamp of the message
  • customParams – custom parameters for the provider

a MotechEvent describing the outbound SMS