I discovered this issue while trying to get delivery report URL out of the SMS entity.
Problem
$provider->send() and $provider->incoming(), have $options parameter.
SMS entity has innate options, but SMS standard class does not.
Proposal
- Remove $options parameter from the provider methods
- Promote setGateway / getGateway from SmsMessageEntityInterface to a common method on the root SmsMessageInterface
- Remove Provider::getGateway. From #2709473: Clarify the difference between sms_incoming operations.
In any case I thought Id put this up for discussion, Is there any reason why this wouldn't work out?
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | message-options-2712521-9.patch | 20.24 KB | dpi |
| #5 | message-options-2712521.patch | 20.25 KB | dpi |
Comments
Comment #2
almaudoh commentedReally, the uses of
$optionsin the originalsms_send()as forsenderandgateway. Since those are now obsolete with the introduction of the SMSProviderandSmsMessageclasses, we can remove options from the Provider classes. So +1 from me for the proposal in the IS.Comment #3
dpiFantastic! DX++
Comment #4
dpiAdded get/setGateway info to OP
Comment #5
dpihttps://github.com/dpi/smsframework/pull/32
Comment #9
dpifixed a test setting gateway via setOption
Comment #11
dpiComment #12
almaudoh commentedJust looking at the patch again, I noticed that you changed a test where the message is sent to the default gateway. Do we have coverage for this elsewhere? I don't have time right now to sift through the whole code base.
Also, while this is a good change, it presents a challenge to the Rule-Based SMS Provider module which will have to create
multiplenew instances of theSmsMessagefor each corresponding gateway (similar to the chunking problem) which may not necessarily be optimal.Interesting to see how that can be solved...
Comment #15
dpiDo you mean
testSmsSendSpecified? I removed half of that test because it was testing default behaviour (overcoverage).Sorry, I'm not very familiar with the module. Im not sure I understand is the issue that needs to be resolved.
Comment #16
dpiTo answer your question properly,
SmsFrameworkProviderTest::testSendhas coverage for normal behaviour.Comment #17
almaudoh commentedModule is here. But no worries...that will be tackled in that project's issue queue.
Comment #18
dpiAlrighty then