Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

At service level, we will be writing one common generic service to send SMS as like sendEmail in OFBiz. The user/developer will need to write the custom service, specific to the API provider/vendor to prepare vendor specific parameters or data which will be needed for calling SMS APIs.


Steps to test the initial pass of the SMS gateway integration:

  1. Download the patch file (OFBIZ-10457) and plugin zip file (msg91.zip) attached to the ticket.
  2. Apply the patch to the latest trunk codebase.
  3. Unzip the msg91.zip file and put the folder into the plugin folder of your truck codebase.
  4. Build and restart the server.
  5. Reload the fresh data or you can load the data following data from XML data import tool.

    <SystemProperty systemResourceId="general" systemPropertyId="telecom.notifications.enabled" systemPropertyValue="N" description="Telecom notifications enabled (Y|N)"/>
    <!-- Telecom Services Seed Data -->
    <EnumerationType enumTypeId="TELECOM_MSG" description="Telcom Message Type Enum" hasTable="N"/>
    <TelecomMethodType telecomMethodTypeId="SMS" description="Short Messaging Service Method"/>
    <TelecomMethodType telecomMethodTypeId="WHATSAPP" description="WhatsApp Messaging Service Method"/>
    <CustomMethodType customMethodTypeId="TELECOM_GATEWAY" description="Telecom Gateway Custom Method"/>

    <!-- Custom Demo Data -->
    <Enumeration enumId="ORDER_SMS" description="Order Placed SMS" enumTypeId="TELECOM_MSG" sequenceId="01"/>
    <Enumeration enumId="INVOICE_SMS" description="Invoice Generated SMS" enumTypeId="TELECOM_MSG" sequenceId="02"/>
    <Enumeration enumId="SHIPMENT_SMS" description="Shipment Initiated SMS" enumTypeId="TELECOM_MSG" sequenceId="03"/>
    <TelecomGatewayConfig telecomGatewayConfigId="MSG91" description="MSG91 SMS Gateway Configuration"/>
    <CustomMethod customMethodId="TG_MSG91" customMethodName="sendMsg91Sms" customMethodTypeId="TELECOM_GATEWAY" description="Service to send SMS using MSG91 Gateway"/>
    <ProductStoreTelecomSetting productStoreId="9000" telecomMethodTypeId="SMS" telecomMsgTypeEnumId="ORDER_SMS" telecomCustomMethodId="TG_MSG91" telecomGatewayConfigId="MSG91" />
    <Msg91GatewayConfig telecomGatewayConfigId="MSG91" apiUrl="http://api.msg91.com/api/sendhttp.php" country="" route="4" authkey="" sender="IOFBIZ"/>

  6. Sign up to the msg91 services to get the authkey and free SMS quota.

  7. Find your authkey after completing the sign up process.
  8. Alter the system property data to change "telecom.notifications.enabled" flag to "Y".
  9. Go to "Msg91GatewayConfig" entity. Here you need to set following fields.
    -- country: Set it to 91 if you want to send SMS in India, set it to 1 if you want to send SMS to USA, for rest of countries, it should be set to 0.
    -- authkey: The authkey you got on your API dashboard once you complete registration process.
  10. After doing all the above mentioned steps, go to webtools and click on run service menu.
  11. Enter service name as "sendTelecomMessage".
  12. Put following parameters:
    -- productStoreId: 9000
    -- telecomMsgTypeEnumId: ORDER_SMS
    -- telecomMethodTypeId: Its optional so can be left blank.
    -- numbers: comma seperated numbers. If you are sending SMS in India or USA, then the numbers should be excluding country code. Otherwise numbers should include country code too.
    -- message: message you want to send to.
  13. After entering the required parameters, run the service.
  14. Wait for some time to receive message on your phone. If it is taking too much time, go to the delivery section of the msg91 console to see if message is submitted to the API provider or not.

...