Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tutorial:adm:modules_sms [2018/03/09 12:57]
michalp fixed english
tutorial:adm:modules_sms [2023/08/18 13:32] (current)
apeterova
Line 1: Line 1:
 ====== Modules - sms: Configurations ====== ====== Modules - sms: Configurations ======
 +
 These configuration items are available within the sms module: These configuration items are available within the sms module:
 +
 <code> <code>
 # Enable property for SMS GET script driver # Enable property for SMS GET script driver
Line 19: Line 21:
 # Phone number that will be used for overriding all recipient number (can be used for testing) # Phone number that will be used for overriding all recipient number (can be used for testing)
 idm.sec.sms.script.get.overrideNumber idm.sec.sms.script.get.overrideNumber
 +
 </code> </code>
  
 It is also necessary to define with sender will be used. These are now available: It is also necessary to define with sender will be used. These are now available:
-  * **defaultScriptSmsSender** - simple sms gateway with check http result codes, 
-  * **defaultHtmlSmsSender** - check http page with response (OK/ERROR must contains the page), 
-  * **defaultSmsBranaSmsSender** - implementation of [[https://www.smsbrana.cz/|SmsBrana]]. 
  
 +  * **defaultScriptSmsSender**  - simple sms gateway with check http result codes,
 +  * **defaultHtmlSmsSender**  - check http page with response (OK/ERROR must contains the page),
 +  * **defaultSmsBranaSmsSender**  - implementation of [[https://www.smsbrana.cz/|SmsBrana]].
 +  * **defaultEmailSmsSender**  - gateway which sends SMS by sending emails to addresses of the form "usersphone@gateemail.tld". E.g. [[https://www.sms-operator.cz/|https://www.sms-operator.cz/]]
 If you want to set up one of these senders, create new configuration property: If you want to set up one of these senders, create new configuration property:
 +
 <code properties> <code properties>
 # sender implementation # sender implementation
 idm.sec.sms.notification-sender.sms.impl=<sender> idm.sec.sms.notification-sender.sms.impl=<sender>
 +
 </code> </code>
 +
 More information about this configuration can be found in [[https://wiki.czechidm.com/devel/documentation/application_configuration/backend#notification_senders|configuration]]. More information about this configuration can be found in [[https://wiki.czechidm.com/devel/documentation/application_configuration/backend#notification_senders|configuration]].
  
 +For defaultEmailSmsSender, it's required to configure the email suffix, where the emails are sent, e.g.:
 +
 +<code properties>
 +# Suffix for sending SMS by emails. The final recipient's address is composed as "usersphone" + suffix
 +idm.sec.sms.script.get.sms.email.sender.suffix=@test.cz
 +
 +</code>
  
 ====== Modules - sms: Script for compose URL ====== ====== Modules - sms: Script for compose URL ======
  
 For a composition of URL for a given gateway, create a script from the System category. As parameters add these variables: For a composition of URL for a given gateway, create a script from the System category. As parameters add these variables:
-  * **login** - login for connect to sms gateway, 
-  * **password** - password as GuardedString (don't forget call method asString) for SMS gateway, 
-  * **number** - number with real recipient, 
-  * **message** - message as plain text, don't log this message, it is possible that this message will contain password as plaintext 
  
 +  * **login**  - login for connect to sms gateway,
 +  * **password**  - password as GuardedString (don't forget call method asString) for SMS gateway,
 +  * **number**  - number with real recipient,
 +  * **message**  - message as plain text, don't log this message, it is possible that this message will contain password as plaintext
 <note important>Attributes like message, number, etc. may contain some characters that aren't passing GET method. So try to encode attributes with URLEncoder.encode</note> <note important>Attributes like message, number, etc. may contain some characters that aren't passing GET method. So try to encode attributes with URLEncoder.encode</note>
  
 ===== Example script ===== ===== Example script =====
 +
 For this script is neccessary add these authorities: For this script is neccessary add these authorities:
 +
   * CLASS: java.net.URLEncoder   * CLASS: java.net.URLEncoder
   * CLASS: java.nio.charset.StandardCharsets   * CLASS: java.nio.charset.StandardCharsets
   * CLASS: sun.nio.cs.UTF_8   * CLASS: sun.nio.cs.UTF_8
 <code> <code>
 +
 import java.net.URLEncoder; import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
Line 57: Line 74:
  
 return "https:/something.tld/example_gateway.php?login=" + login + "&password=" + password.asString() + "&message=" + messageEncoded + "&number=" + numberEncoded + "&someTestAttribute=test123"; return "https:/something.tld/example_gateway.php?login=" + login + "&password=" + password.asString() + "&message=" + messageEncoded + "&number=" + numberEncoded + "&someTestAttribute=test123";
 +
 </code> </code>
 +
 +
  • by michalp