Staff staff = null;
if (this.fromApiJsonHelper.parameterExists(SmsApiConstants.staffIdParamName, element)) {
final Long staffId = this.fromApiJsonHelper.extractLongNamed(SmsApiConstants.staffIdParamName, element);
staff = this.staffRepository.findOneWithNotFoundDetection(staffId);
mobileNo = staff.mobileNo();
}
final String message = this.fromApiJsonHelper.extractStringNamed(SmsApiConstants.messageParamName, element);
return SmsMessage.pendingSms(group, client, staff, message, mobileNo);