Integration manual v1.3.0, v1.4.0


Installation

  • Stop the server
  • Download jars from plugin and add them (ametys-plugin-sms-1.4.x.jar and ametys- plugin-sms-resources-1 .4.x.jar ) in the WEB-INF/lib directory of your application. Ametys
  • Add buttons to open the mailing list management tool (org.ametys.plugins.sms.SmsList) and send SMS (org.ametys.sms.SendSMS) in the WEB-INF/params/cms-ribbon-default.xml.
    We recommend adding it to the Home tab, in a new "SMS" group.

  • In the same file, import the ribbon file specific to SMS mailing lists. plugin:sms://cms-ribbon,.xml

    <tabs>
        <tab label="RIBBON_TABS_TAB_HOME_LABEL">
            <groups>
                [...]
                <group label="RIBBON_TABS_TAB_HOME_GROUPS_GROUP_SMS_LABEL" icon="">
    				<large/>
    				<medium>
    					<control id="org.ametys.sms.SendSMS"/>
    					<control id="org.ametys.plugins.sms.SmsList"/>
    				</medium>
    				<small/>
                </group>
                [...]
            </groups>
        <tab>
        [...]
    
        <import>plugin:sms://cms-ribbon.xml</import>
    </tabs>
    
    



  • Choose the SMS provider (broker) to be used for sending SMS (see next chapter)

    <org.ametys.plugins.sms.broker.Broker>org.ametys.plugins.sms.broker.EtoileDieseBroker</org.ametys.plugins.sms.broker.Broker>
    
  • Restart the server

Choice of SMS connector (broker)

SMS is sent via a service provider, known as a "broker".

To send SMS messages, you must choose a broker from those proposed by plugin or write your own broker. A broker is a simple extension point.

The plugin SMS provides 2 brokers:

  • org.ametys.plugins.sms.broker.LoggerBroker
    This implementation doesn't send SMS messages; it simply traces dummy messages in the application logs. It is therefore a test implementation only.

 

  • org.ametys.plugins.sms.broker.EtoileDieseBroker
    This implementation uses Etoile Dièse 's web service to send SMS messages. To use this broker, you must have an Etoile Dièse account.

In the WEB-INF/param/runtime.xmldeclare the broker to be used:

<org.ametys.plugins.sms.broker.Broker>org.ametys.plugins.sms.broker.EtoileDieseBroker</org.ametys.plugins.sms.broker.Broker>

You can also write your own broker (see Plugin SMS - Developer manual v1.2.0).

Certificate error
When sending SMS messages from the back office, you may receive the following error message (depending on the broker used):

peer not authenticated
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated 
    at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352) 
    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128) 
If this is the case, you need to import the broker's certificate into your JVM:
keytool -alias "etoilediese" -import -file ssl.etoilediese.fr -keystore /path/to/jvm/jre/lib/security/cacerts -trustcacerts

 

Broker configuration for mailing list unsubscription

To comply with legislation, you may need to allow your users to unsubscribe from the SMS mailing list.

Si vous avez souscrit à un service STOP SMS auprès de votre fournisseur, vous devrez lui donner l'URL de désabonnement. L'url à fournir est: http://<url_monsite>/_plugins/sms/stop-sms où url_monsite est l'url de votre site Ametys.

Help for contributors: personalized help when sending SMS messages

When sending SMS messages, a text at the bottom of the dialog box invites contributors to add to the end of the SMS message the procedure for unsubscribing from the mailing list:

It may be useful to overload this help text to adapt it to your subscription with your SMS provider. For example: To comply with legislation, add at the end of the message "To stop receiving messages from us, send STOP to 36 XXX".

For this purpose overload the key i18n PLUGINS_SMS_SEND_DIALOG_HINT2 in the WEB-INF/i18n/plugins/sms/message_en.xml:

<?xml version="1.0" encoding="UTF-8"?>
<catalogue xml:lang="fr">
	<message key="PLUGINS_SMS_SEND_DIALOG_HINT2">Pour être en conformité avec la législation, pensez à ajouter en fin de message \"Pour ne plus recevoir de message de notre part, envoyez STOP au 36 XXX\".</message>
</catalogue>

 

 

Back to top

SMS