[Bps-public-commit] rt-extension-notifysms branch, cleanup-initial-release, repushed

Craig Kaiser craig at bestpractical.com
Tue Feb 2 16:52:06 EST 2021


The branch cleanup-initial-release was deleted and repushed:
       was f5d488bb16487f768dd0d5d7ef96d96f18b30ff1
       now 2dd5beb37cf8ae4903f137b26bf5039203a2e0ad

1:  65f66fd = 1:  65f66fd Update Module::Install
2:  e350d90 = 2:  e350d90 Update overlay of NotifySMS::SetRecipients
3:  1a109b7 = 3:  1a109b7 Parse template object in Prepare method if no MIMEObj exist
4:  d74dbe4 ! 4:  4530878 Make documentation clearer
    @@ -6,9 +6,11 @@
     --- a/README
     +++ b/README
     @@
    -     messages.
    - 
    - DESCRIPTION
    + NAME
    +     RT-Extension-NotifySMS - Provide additional actions to send text
    +-    messages.
    +-
    +-DESCRIPTION
     -    Provide additional actions for Scrips, that allow for the sending of
     -    messages inplace of email. The new action can be loaded in the web UI
     -    from:
    @@ -22,8 +24,7 @@
     -    For the action you can choose to pass the following parameters:
     -
     -        All, Owner, Requestor, AdminCc, Cc
    -+    Provide additional actions for Scrips, that allow for the sending of SMS
    -+    messages alongside of email.
    ++    messages
      
      RT VERSION
     -    Works with RT 4.4.0
    @@ -36,12 +37,16 @@
              database.
      
     -    Edit your /opt/rt4/etc/RT_SiteConfig.pm
    +-        If you are using RT 4.4 or greater, add this line:
     +    Edit your /opt/rt5/etc/RT_SiteConfig.pm
    -         If you are using RT 4.4 or greater, add this line:
    ++        Add this line:
      
                  Plugin('RT::Extension::NotifySMS');
    -@@
    -         action is being used, see the module for specifications.
    + 
    +-        You will also need to set other config values depending on which sms
    +-        action is being used, see the module for specifications.
    ++        You will also need to set other config values depending on which SMS
    ++        action is being used. See CONFIGURATION for details.
      
          Clear your mason cache
     -            rm -rf /opt/rt4/var/mason_data/obj
    @@ -49,45 +54,55 @@
      
          Restart your webserver
      
    ++DESCRIPTION
    ++    Provide additional actions for Scrips, that allow for the sending of SMS
    ++    messages based on actions in RT.
    ++
    ++    Notify SMS actions use the Mobile Phone value from each user record. If
    ++    the user has no Mobile Phone set, no message is sent.
    ++
    ++    After installation you will see new notification actions are available
    ++    for your RT scrips.
    ++
    ++    If notifying a more specific role on a ticket is desired, create a new
    ++    action in the RT web UI:
    ++
    ++        Admin->Global->Actions
    ++
    ++    The "Action Module" is "NotifyTwilio". In the "Parameters to Pass"
    ++    section provide one or more of the following:
    ++
    ++        All, Owner, Requestor, AdminCc, Cc
    ++
    ++    The content of your outgoing SMS alerts is set using RT templates the
    ++    same way email notification content is set. One caveat is that SMS
    ++    notification templates should not have any header values, meaning that
    ++    they will have a blank line as the first line in the template ( Only
    ++    applicable for Perl templates ).
    ++
    ++    To send "on reply" content via SMS use the following template:
    ++
    ++    {$Transaction->Content()}
    ++
    ++    With an empty line before the above code.
    ++
     +CONFIGURATION
    ++    Currently this extension supports the Twilio SMS service.
    ++
     +  Twilio
    -+    The `make initdb` command creates a new RT::Action called Notify Twilio.
    -+
    -+    You can now use this action in your RT::Scrips, just like existing
    -+    notification scrips use email notification actions.
    -+
    -+    By default the Notify Twilio action provides alerts to all of the
    -+    following roles:
    -+
    -+        Owner, Requestor, AdminCc, Cc
    -+
    -+    If you'd like a more specific role on a ticket notified, then you can
    -+    create a new action in the RT web UI:
    -+
    -+        Admin->Global->Actions
    -+
    -+    Where the "Action Module" is "NotifyTwilio". Then in the "Parameters to
    -+    Pass" section you can provide one or more of the following options:
    -+
    -+        All, Owner, Requestor, AdminCc, Cc
    -+
    -+    It is important to remember that only user records that have a value for
    -+    the "Mobile Phone" attribute will be able to receive SMS alerts.
    -+
    -+   NotifyTwilio
    -+    Send a message using the Twilio web api, requires the follow config
    -+    values from RT_SiteConfig.pm:
    -+
    -+            Set($TwilioAccounId, 'Secret');
    -+            Set($TwilioAuthToken, 'Secret');
    -+            Set($APIURL, 'https://api.twilio.com/2010-04-01/Accounts/');
    -+            Set($APIDomain, 'api.twilio.com:443');
    -+            Set($APIRealm, 'Twilio API');
    -+            Set($MessageSender, '0123456789');
    -+
    -+    To obtain the Twilio AuthToken and AccountId create a new project of
    -+    type programmable sms. Once done setting up the project you will have
    -+    access to the projects AccountId and AuthToken.
    ++    To send a message using the Twilio web API, set the following values in
    ++    RT_SiteConfig.pm:
    ++
    ++            Set( $TwilioAccounId, 'Secret' );
    ++            Set( $TwilioAuthToken, 'Secret' );
    ++            Set( $APIURL, 'https://api.twilio.com/2010-04-01/Accounts/' );
    ++            Set( $APIDomain, 'api.twilio.com:443' );
    ++            Set( $APIRealm, 'Twilio API' );
    ++            Set( $MessageSender, '0123456789' );
    ++
    ++    To obtain a Twilio AuthToken and AccountId, create a new project of type
    ++    programmable SMS in the Twilio console. These values can be found in
    ++    your Twilio account <https://www.twilio.com/console>.
     +
      AUTHOR
          Best Practical Solutions, LLC <modules at bestpractical.com>
    @@ -139,8 +154,12 @@
     +++ b/lib/RT/Extension/NotifySMS.pm
     @@
      
    - =head1 DESCRIPTION
    - 
    + =head1 NAME
    + 
    +-RT-Extension-NotifySMS - Provide additional actions to send text messages.
    +-
    +-=head1 DESCRIPTION
    +-
     -Provide additional actions for Scrips, that allow for the sending of messages
     -inplace of email. The new action can be loaded in the web UI from:
     -
    @@ -153,8 +172,7 @@
     -For the action you can choose to pass the following parameters:
     -
     -    All, Owner, Requestor, AdminCc, Cc
    -+Provide additional actions for Scrips, that allow for the sending of SMS
    -+messages alongside of email.
    ++RT-Extension-NotifySMS - Provide additional actions to send text messages
      
      =head1 RT VERSION
      
    @@ -170,9 +188,14 @@
     -=item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
     +=item Edit your F</opt/rt5/etc/RT_SiteConfig.pm>
      
    - If you are using RT 4.4 or greater, add this line:
    - 
    -@@
    +-If you are using RT 4.4 or greater, add this line:
    ++Add this line:
    + 
    +     Plugin('RT::Extension::NotifySMS');
    + 
    + You will also need to set other config values depending on which
    +-sms action is being used, see the module for specifications.
    ++SMS action is being used. See L<CONFIGURATION> for details.
      
      =item Clear your mason cache
      
    @@ -183,47 +206,56 @@
      
      =back
      
    ++
    ++=head1 DESCRIPTION
    ++
    ++Provide additional actions for Scrips, that allow for the sending of SMS
    ++messages based on actions in RT.
    ++
    ++Notify SMS actions use the Mobile Phone value from each user record. If the
    ++user has no Mobile Phone set, no message is sent.
    ++
    ++After installation you will see new notification actions are available for your RT scrips.
    ++
    ++If notifying a more specific role on a ticket is desired, create a new
    ++action in the RT web UI:
    ++
    ++    Admin->Global->Actions
    ++
    ++The "Action Module" is "NotifyTwilio". In the "Parameters to Pass" section
    ++provide one or more of the following:
    ++
    ++    All, Owner, Requestor, AdminCc, Cc
    ++
    ++The content of your outgoing SMS alerts is set using RT templates the same
    ++way email notification content is set. One caveat is that SMS notification
    ++templates should not have any header values, meaning that they will have a
    ++blank line as the first line in the template ( Only applicable for Perl templates ).
    ++
    ++To send "on reply" content via SMS use the following template:
    ++
    ++{$Transaction->Content()}
    ++
    ++With an empty line before the above code.
    ++
     +=head1 CONFIGURATION
     +
    ++Currently this extension supports the Twilio SMS service.
    ++
     +=head2 Twilio
     +
    -+The `make initdb` command creates a new RT::Action called Notify Twilio.
    -+
    -+You can now use this action in your RT::Scrips, just like existing notification
    -+scrips use email notification actions.
    -+
    -+By default the Notify Twilio action provides alerts to all of the following roles:
    -+
    -+    Owner, Requestor, AdminCc, Cc
    -+
    -+If you'd like a more specific role on a ticket notified, then you can create a new
    -+action in the RT web UI:
    -+
    -+    Admin->Global->Actions
    -+
    -+Where the "Action Module" is "NotifyTwilio". Then in the "Parameters to Pass" section
    -+you can provide one or more of the following options:
    -+
    -+    All, Owner, Requestor, AdminCc, Cc
    -+
    -+It is important to remember that only user records that have a value
    -+for the "Mobile Phone" attribute will be able to receive SMS alerts.
    -+
    -+=head3 NotifyTwilio
    -+
    -+Send a message using the Twilio web api, requires the follow
    -+config values from RT_SiteConfig.pm:
    -+
    -+        Set($TwilioAccounId, 'Secret');
    -+        Set($TwilioAuthToken, 'Secret');
    -+        Set($APIURL, 'https://api.twilio.com/2010-04-01/Accounts/');
    -+        Set($APIDomain, 'api.twilio.com:443');
    -+        Set($APIRealm, 'Twilio API');
    -+        Set($MessageSender, '0123456789');
    -+
    -+To obtain the Twilio AuthToken and AccountId create a new project of type
    -+programmable sms. Once done setting up the project you will have access to
    -+the projects AccountId and AuthToken.
    ++To send a message using the Twilio web API, set the following values in RT_SiteConfig.pm:
    ++
    ++        Set( $TwilioAccounId, 'Secret' );
    ++        Set( $TwilioAuthToken, 'Secret' );
    ++        Set( $APIURL, 'https://api.twilio.com/2010-04-01/Accounts/' );
    ++        Set( $APIDomain, 'api.twilio.com:443' );
    ++        Set( $APIRealm, 'Twilio API' );
    ++        Set( $MessageSender, '0123456789' );
    ++
    ++To obtain a Twilio AuthToken and AccountId, create a new project of type
    ++programmable SMS in the Twilio console. These values can be found in
    ++your L<Twilio account|https://www.twilio.com/console>.
     +
     +=cut
     +
5:  f5d488b ! 5:  a3adbdb Use RT::Scrip object to call SendMessage
    @@ -17,3 +17,4 @@
              Recipients => $self->{'SMS'},
              Msg        => $content,
          );
    +
-:  ------- > 6:  0c0c8a6 Overlay RT::ActionSendEmail->AddressesFromHeader
-:  ------- > 7:  2dd5beb Add example SMS Correspondence template



More information about the Bps-public-commit mailing list