aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SMS.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/SMS.pm')
-rw-r--r--perllib/FixMyStreet/SMS.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/SMS.pm b/perllib/FixMyStreet/SMS.pm
index dff27e018..874108706 100644
--- a/perllib/FixMyStreet/SMS.pm
+++ b/perllib/FixMyStreet/SMS.pm
@@ -28,6 +28,11 @@ has from => (
default => sub { FixMyStreet->config('TWILIO_FROM_PARAMETER') },
);
+has messaging_service => (
+ is => 'lazy',
+ default => sub { FixMyStreet->config('TWILIO_MESSAGING_SERVICE_SID') },
+);
+
sub send_token {
my ($class, $token_data, $token_scope, $to) = @_;
@@ -51,7 +56,8 @@ sub send_token {
sub send {
my ($self, %params) = @_;
my $output = $self->twilio->POST('Messages.json',
- From => $self->from,
+ $self->from ? (From => $self->from) : (),
+ $self->messaging_service ? (MessagingServiceSid => $self->messaging_service) : (),
To => $params{to},
Body => $params{body},
);