Commit 90650882 authored by Kjetil Thuen's avatar Kjetil Thuen

Warn and trunkate message if it is over 140 char

parent bada50ef
......@@ -35,6 +35,11 @@ public abstract class SMSSend {
String prefix = getOption("global.message.prefix");
String suffix = getOption("global.message.suffix");
String message = prefix + " " + mainContent + " " + suffix;
if (message.length() > 140) {
logger.warn("Message is too long. Will be trunkated");
message = message.substring(0, 139);
}
return message;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment