Jump to content
  • 0

How To Setup Response With Universal Module?


wdfee

Question

Hello,

 

I read the documentation but still don't know how to use the response settings of the universal module. Could you give an example for this?

 

What (in what kind of format) should be inserted to:

Post URL/Email HTTP Code Response Contains

 

I tried putting an email address in Post URL/Email, and I successfully got an email. But how can I get some more information into it?

Or, much more exciting: When I want to send the response to an URL, that something can be processed, what do I have to put in "HTTP Code" and "Response Contains"?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

In the email notification I'm a step further: If I add e.g. an option "service_field_1" to the module product, I can referentiate it with {service_field_1} in the email that is sent to the address I specified in "Post URL/Email". In the client mail (set in the package) I can referentiate it with "{service.service_field_1}".

What I didn't get yet is to referentiate something in the "_other" array, e.g. the client_id.

 

And i didn't get any Post URL processing yet.

Link to comment
Share on other sites

  • 0

I have the same question. Information such as what variables are available for use in the Email Notification or what variables are posted to the given URL when using the Universal Module would be very helpful. My primary confusion is how to pass the order information to either another script or include it in an email so the order can be manually processed. The default email notification contains "{% debug %}", but this doesn't seem to include any information about the order. All that is sent in the email notification is:

 

Array
(
    [h2o] => H2o_Info Object
        (
            [h2o_safe] => Array
                (
                    [0] => filters
                    [1] => extensions
                    [2] => tags
                )

            [name] => H2o Template engine
            [description] => Django inspired template system
            [version] => 0.3
        )

    [base_uri] => cryobackup.com/
    [admin_uri] => cryobackup.com/admin/
    [client_uri] => cryobackup.com/client/
    [_other] => 
)

How can I include the order information such as username, password, product, notice type, etc.?

Link to comment
Share on other sites

  • 0

Anyone?

 

I've been manually looking up orders in Blesta to see what a customer ordered, then provisioning the service. It would really be nice to have some more documentation about the universal module and specifically what variables you can include in the HTML/Text area. 

Link to comment
Share on other sites

  • 0

Anyone?

 

I've been manually looking up orders in Blesta to see what a customer ordered, then provisioning the service. It would really be nice to have some more documentation about the universal module and specifically what variables you can include in the HTML/Text area. 

 

The variables sent in the POST or email through the universal module for provisioning services are those that are configured for the universal product. See Service Options.

Link to comment
Share on other sites

  • 0

So after 4 hours of frustrating search I came across this post and it is still only a vague and partially incorrect answer.  It would be very helpful to explain in the documentation what gets POSTed under the Service Option when using the Universal Module.

 

I figured out the following by posting to a php page to print out the results to a file.

 

First, how I have the product configured in the Service Options Notifications:

 

I have two Options (fields):,  website and chataddress

 

In the Notices I have the following.  I found you can pass parameters in the URL (not explained anywhere).  The chatdemo is just a test/dev site separate from where Blesta is installed. The http or https is required to flag is as URL. 

Add  -> http://chatdemo.mydomain.com/api.php?addservice=1
Suspend -> http://chatdemo.mydomain.com/api.php?suspend=1
Unsuspend -> http://chatdemo.mydomain.com/api.php?suspend=0

I have not tested "HTTP code" or "Response Contains".  As far as I can tell this only is useful if not successful. I don't know what happens in Blesta if it is not.  

 

In the api.php file is the following. I used REQUEST to also get the parameters 

$fp = fopen('file.txt', 'w');
fwrite($fp, print_r($_REQUEST, TRUE));
fclose($fp);
return "OK";
 
In the admin panel I added a service manually for a user and activated it. This is the response:
Array
(
    [addservice] => 1
    [website] => www.test2.com
    [chataddress] => 
    [_other] => Array
        (
            [package_group_id] => 2
            [pricing_id] => 1
            [module_row_id] => 1
            [qty] => 1
            [client_id] => 2
            [status] => active
            [use_module] => true
            [meta] => Array
                (
                    [website] => www.test2.com
                    [chataddress] => 
                )


            [coupon_packages] => Array
                (
                    [0] => 1
                )


            [date_added] => 2014-10-25 18:30:10
            [date_renews] => 2014-11-25 18:30:10
        )


)
The "addservice" was passed as a parameter.
The  "website" and "chataddress"  are two fields in the Service Options
The "other" was passed by the system.
 
 
 
When I used the admin panel to Suspend a service this is all I received.  
Array
(
    [suspend] => 1
    [chataddress] => 
    [website] => www.test2.com
)

The "suspend" was in the url.

The other two fields are the Service Options.

 
 
NOTE: If you have a service for a user that is still Pending (maybe had an error) and you Activate it, the "Add"  URL does not get called.   If you are using a call to that url to provision your server (like my api.php) it will not be provisioned.  I guess the Activate only changes the status and sends an email (if checked).  Activate can on be done once as far as I can tell so not sure why it works this way.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...