Přejít k obsahu  Přejít k hlavnímu menu

Blog / Knowledge base

Updated: 5. August 2020

Webhook

Data transfer from Mailocator via Webhook to third parties

Supported data formats

Data formats: filed name=value&..., XML, JSON and data aggregated into a POST variable data



Supported HTTP methods

Most formats can be combined with HTTP methods GET, POST or PUT



Basic structure of transmitted data

At least the following fields (variables) are returned in each request:
engine - contains "Mailocator"
time - contains unix timestamp of sending the request
email - contains a valid email address

Optionally, additional data from the popup form sent by the action can be added subscribe



Examples

Request with POST method and JSON format
Return data, result of PHP function call var_export($_POST,1)


array (
'{"engine":"Mailocator","time":1596634651,"email":"test@mlctr_com"}' => '',
)







Request with POST method and XML format
Return data, result of PHP function call var_export($_POST,1)


array ('<?xml version="1.0"?>
<contact>
    <engine>Mailocator</engine>
    <time>1596634651</time>
    <email>test@mlctr.com</email>
</contact>'



Request with POST method and XML format
Return data, result of PHP function call file_get_contents('php://input')


<?xml version="1.0"?>
<contact>
<engine>Mailocator</engine>
<time>1596634651</time>
<email>test@mlctr.com</email>
</contact>










Expected return codes from a third-party server:


1 - contact saved successfully, Mailocator will display a thank you note
0 - contact was not saved successfully, Mailocator displays information about the duplicate contact

If the content is different or empty, the processing process is interrupted by Mailocator, an error is written in the monitoring.

PHP example


After successfully processing the request on the server, just call echo '1';, the return value is interpreted as a correctly stored contact.

RELATED

Content replacement tags

There are several ways to copy arbitrary fields to campaign content, including influencing CSS class names, in Mailocator.

Action setval - change of values in Mailocator forms

The setval action can be used to dynamically change the default value in pop-ups

Connect and make forms for dialog-Mail

See how to easily connect dialog-Mail and build and setup subscription popup

Changes in the import of discount codes from 1 December 2020

If you use discount codes in Mailocator, please pay attention to the following information

Draw a random discount code

Do you need to draw a random win or a code to gamble popup? Mailocator allows you to easily set the probability to one hundredth of a percent, randomly select a win and deliver it to the email tool.

Launch a campaign using a URL

You can also invoke Mailocator campaigns or designs at any time using a parameter in your site´s URL