The other day I came across a curious service Corp2World (hereinafter referred to as C2W) and decided to try it out. I found nothing but instructions on the site. On the forums, this service was practically not discussed, examples for the 1C platform I also could not find. Therefore, I decided to "dig a little" in this direction and try out the service for 1C-ki. As it turned out nothing complicated in this, and moreover it is a really useful and interesting service.
Following the
link , having previously read the
documentation , I downloaded the configuration and performed the merger with the fitting room “1C: Manufacturing Enterprise Management for Ukraine”. The procedure is very easy and easy. The downloaded configuration contains only 1 common module, which allows you to send a request for the C2W service via the https protocol. There are several procedures in the module, but only one is needed for sending: “Send For Handling To Server C2W”. In the comments of this module all the steps for sending are described in detail and clearly. In fact, you only need to specify the data access to the service (user and password), subject, message text and the list of recipients. So in order.
I will begin, perhaps, with user registration on the service C2W.
Go to the
site Corp2World and select the item registration, fill in the required fields, unforgettable about the time zone (so the message time will be displayed correctly). After registration, do not forget to activate your account by clicking on the link that you will receive via email and accept the license agreement, otherwise messages will not be delivered.
Next, go to the "Download" section and look for a link to the configuration file for 1C, familiarize yourself with the instructions and perform the indicated actions (the procedure takes about 5 minutes, taking into account "carefully read 3 times"). For example, he took as a basis the configuration of “1C: Manufacturing Enterprise Management for Ukraine”, since it was, at the moment, the only deployed test configuration that it was not a pity to “kill” for the purposes of the experiment naturally. After the merging of configurations, the core2 module appeared in the “common modules” objects. It contains all the necessary functionality (along with detailed comments), which quickly allows you to start using the C2W service.
')

The module code is open, so it’s easy for anyone to “finish” it, for its own purposes (for example, by default, after sending, a message status window pops up (sent successfully or not) and you can both turn them off and, for example, add code for logging messages). Understanding how this all works is not difficult - you just have to open the 1C syntactical assistant, and the whole technology becomes clear.

The service supports two modes of operation:
- The list of possible recipients is configured on the service in the communication channels section, in this case, a message arrives at the service without specifying the recipient and, depending on the message context and channel filter settings, is delivered to the specified addresses (email, sms, ISQ, etc.).
- The list of recipients comes in the body of the message, and the service only delivers them.
For 1C or other similar systems, the 2nd option is most preferable, since the database already usually contains information about phones and email clients and users. Based on this example, which I will give, will use this mode of service.
I will use two main functions:
“Insert Mass Recipient” - create a list of recipients of a message, namely the type of recipient (email, ISQ, telephone, etc.) and its address (phone number, ISQ number, etc.).
“Send To Handling on ServerS2W” - directly sending a message, which will indicate the subject of the message, the text of the message and the access to the service (username and password of the account you registered).
Next was the question of how and where to use it in the 1C system. Without thinking twice, hundreds of ideas came to mind, starting to inform the top manager about the processes in the enterprise, ending with sending a message to customers' mobile phones about the delivery or availability of goods in the store. An example of using the service came to my mind: there is a retail (or wholesale) warehouse and NTT. An NTT requires a certain amount of a product. Warehouse, after carrying out the document "Moving Goods", must inform the NTT responsible person that the transfer has already been completed at his request. All this is solved quite simply.
For a start, I would like to determine which channel should send messages. In this configuration, the most suitable were E-Mail and telephone. But I would like to expand these channels and add the ability to use the ICQ service, as this is the most popular Russian messaging service. To do this, in the types of contact information lists add a new element “ICQ”.

So, we have decided on what channels the service will be used. In this case, this is e-mail and ICQ.
Next, in the Configuration window, add a subscription to events.

We give it a name, indicate the source (in this example, the document “Relocation of Goods”), the event - “Handle processing” (this means that this event will occur only when the document is at the stage of conducting) and specify the handler - the module where it will be formed event handling procedure. Click on the "Magnifier" icon to switch to the procedure editing mode.

Next, write the following small code:

Channel number of the corresponding email. Mail (underlined "1" in the screenshot) and ICQ (underlined "5" in the screenshot), as well as the numbers of other channels, can be seen in the comments of the module "Core C2W", or on the service website itself.
Everything, now we have a realized example of sending a message by e-mail and “ICQ” to the responsible persons of the recipient’s warehouse (in our example this will be NTT). We save and update the configuration and can use it.
To test the example, we perform the following steps:
- We will create a kind of “responsible person” for some NTT, and in the section “addresses and phone numbers” we will specify at least one E-Mail and ICQ.


- We will create a certain NTT and assign the previously created nat. To be the “responsible person”. face.


- Create and carry out the document "Moving Goods". After holding you should see the following:


Now you can safely check the "mail" and "ICQ", which we indicated for physical. persons in paragraph 1.
Result:
Moving goods NF000000006 from 06/30/2011 14:07:18
notifier@corp2world.com
who: me
Disposable glasses 50ml, Disposable plates; From the warehouse: Main warehouse; In the warehouse: Kiosk "Everything for the house";
- Corp2World Notifier