Closed ajohn25 closed 7 months ago
Goals:
Non-Goals:
Mid February release goal
Users must find an image to attach to a long SMS to convert the messsage to MMS
Schema Changes:
N/A - maximum SMS length will be tracked via an organization setting
Backend Changes:
maximumSMSLength
as an organization setting which defaults to 3 segments. Under all currently proposed pricing structures, a 4 segment SMS is more expensive than 1 MMS message.sendMessage
in assemble-numbers so that mediaUrls
is set to an empty array when an SMS message is longer than the set maximum SMS lengthmediaUrls
must have a length UI Changes:
TBD
See alternatives listed at top of issue
Write tests as part of PR
For proposed backend changes, note that there are 2 messages in switchboard currently with empty array media URLs. These were the 1st 2 messages sent during initial setup, so proposing this solution with the assumption that empty media URLs are not currently sent from Spoke under normal conditions.
These 2 messages which I believe to be exceptions can be found via this query
select * from outbound_messages where id in ('631c1f14-9711-11ee-80ff-d3689a7cf198', 'fbd7146c-971a-11ee-80ec-4f2f548ea12a')
@bchrobot could you review the proposal above?
Sounds good overall. A few pieces of feedback:
maximumSMSLength
-> maxSmsSegmentLength
to clarify that it's segments. Ideally this would also convey conversion to MMS but I didn't love any of the ideas I came up with for that (mmsAutoConversionSegmentCount
, mmsConversionAfterNSegments
, maxSmsSegmentsBeforeAutoMms
)UPDATE ... SET features = (features::jsonb || jsonb_build_object('maximumSMSLength', 3))::text
) or include example SQL in PR description to be run manually
createOrganization
mutation to set this for new orgs
https://github.com/With-the-Ranks/Spoke/blob/b8761c733bbca905651b7067d27eb2140f5929b7/src/server/api/root-mutations.ts#L1239-L1250media_urls = []
:
https://github.com/politics-rewired/switchboard/blob/00281a6036d081013b37590c8df2c0193d45abce/schema-dump.sql#L2874-L2889
Is your feature request related to a problem? Please describe. Many organizations would prefer that longer messages be automatically converted to MMS, which can be cheaper to send than many segment long SMS messages.
Describe the solution you'd like An organization setting that sets a limit for how long SMS messages can be for the organization. Messages above this segment limit should be automatically converted to MMS.
Describe alternatives you've considered