With-the-Ranks / Spoke

With the Rank's fork of Politics Rewired's fork of Spoke
GNU General Public License v3.0
0 stars 0 forks source link

Support sending MMS without an image #1

Closed ajohn25 closed 7 months ago

ajohn25 commented 8 months ago

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

ajohn25 commented 8 months ago

Goals and Non-Goals

Goals:

Non-Goals:

Milestones

Mid February release goal

Existing Solution

Users must find an image to attach to a long SMS to convert the messsage to MMS

Proposed Solution

Schema Changes:

N/A - maximum SMS length will be tracked via an organization setting

Backend Changes:

  1. Track 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.
  2. Adjust sendMessage in assemble-numbers so that mediaUrls is set to an empty array when an SMS message is longer than the set maximum SMS length
  3. Remove the restriction in switchboard's telnyx service that mediaUrls must have a length
  4. Telnyx will send an empty array of media URLs as MMS (should test to confirm)

image

UI Changes:

TBD

Alternative Solutions

See alternatives listed at top of issue

Testability, Monitoring and Alerting

Write tests as part of PR

Cross-Team Impact

Open Questions

  1. Backend changes review
  2. UI review

Detailed Scoping and Timeline

ajohn25 commented 8 months ago

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')

ajohn25 commented 8 months ago

@bchrobot could you review the proposal above?

bchrobot commented 8 months ago

Sounds good overall. A few pieces of feedback: