Outgoing webhook (subscriber's custom fields request)

PavelL

New Member
I`m trying to set up outgoing webhooks from Mailwizz to Bitrix24 CRM sending contact information of subscribers who clicked links.

Mailwizz sends subscriber`s e-mail via webhook and Bitrix24 CRM receive it correctly now. There are some custom fields (custom tags) for subscribers, such as NAME, PHONE, ADDRESS etc., but I`m not able to compose correct request to database, get values of this fields for link-clicked subscribers and transfer it to bitrix 24 via webhook
I need a help whith composing such reqest at SendCampaignsWebhooksCommand.php
 

twisted1919

Administrator
Staff member
@PavelL - Let's first make sure we're on same page here, okay.
Currently this is the data structure mailwizz sends along:
PHP:
$data = CMap::mergeArray(array(
                'event' => array(
                    'type'          => 'n/a',
                    'ip_address'    => '',
                    'user_agent'    => '',
                    'date_added'    => '',
                ),
                'timestamp' => time(),
                'list'  => array(
                    'attributes' => $list->getAttributes(array(
                        'list_uid', 'name',
                    )),
                ),
                'subscriber' => array(
                    'attributes' => $subscriber->getAttributes(array(
                        'subscriber_uid', 'email', 'source', 'status', 'ip_address'
                    )),
                    'fields' => $fieldsWithValues,
                ),
                'campaign' => array(
                    'attributes' => $campaign->getAttributes(array(
                        'campaign_uid', 'name',
                    )),
                ),
            ), $customData);
You also need the custom fields values, right?
they are available, see how the subscriber structure looks like:
PHP:
'subscriber' => array(
                    'attributes' => $subscriber->getAttributes(array(
                        'subscriber_uid', 'email', 'source', 'status', 'ip_address'
                    )),
                    'fields' => $fieldsWithValues,
                ),
The 'fields' key contains all the custom fields, like FNAME / LNAME / etc, so it's all there.

Let me know if anything unclear.
 
Top