{
    "name": "Sync Justimmo Newsletter Subscriptions to Brevo",
    "flow": [
        {
            "id": 4,
            "module": "app#justimmo-z48jab:OnNewsletterSubUnsub",
            "version": 1,
            "parameters": {
                "__IMTHOOK__": 1859654
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": 0,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "__IMTHOOK__": {
                            "data": {
                                "editable": "false"
                            },
                            "label": "On Newsletter Subscribe/Unsubscribe"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTHOOK__",
                        "type": "hook:app#justimmo-z48jab4",
                        "label": "Webhook",
                        "required": true
                    }
                ]
            }
        },
        {
            "id": 5,
            "module": "builtin:BasicRouter",
            "version": 1,
            "filter": {
                "name": "CategoryID",
                "conditions": [
                    [
                        {
                            "a": "{{4.data.category_id}}",
                            "b": "",
                            "o": "text:equal"
                        }
                    ]
                ]
            },
            "mapper": null,
            "metadata": {
                "designer": {
                    "x": 300,
                    "y": 0
                }
            },
            "routes": [
                {
                    "flow": [
                        {
                            "id": 6,
                            "module": "app#justimmo-z48jab:GetContactDetails",
                            "version": 1,
                            "parameters": {
                                "__IMTCONN__": 6359943
                            },
                            "filter": {
                                "name": "Subscribe",
                                "conditions": [
                                    [
                                        {
                                            "a": "{{4.event}}",
                                            "b": "newsletter:subscribe",
                                            "o": "text:equal"
                                        }
                                    ]
                                ]
                            },
                            "mapper": {
                                "tenantId": "{{4.data.tenant_id}}",
                                "contactId": "{{4.data.contact_id}}"
                            },
                            "metadata": {
                                "designer": {
                                    "x": 643,
                                    "y": -235
                                },
                                "restore": {
                                    "parameters": {
                                        "__IMTCONN__": {
                                            "data": {
                                                "scoped": "true",
                                                "connection": "app#justimmo-z48jab"
                                            },
                                            "label": "Justimmo BusinessAPI"
                                        }
                                    }
                                },
                                "parameters": [
                                    {
                                        "name": "__IMTCONN__",
                                        "type": "account:app#justimmo-z48jab",
                                        "label": "Connection",
                                        "required": true
                                    }
                                ],
                                "expect": [
                                    {
                                        "name": "tenantId",
                                        "type": "uinteger",
                                        "label": "Tenant ID",
                                        "required": true
                                    },
                                    {
                                        "name": "contactId",
                                        "type": "uinteger",
                                        "label": "Contact ID",
                                        "required": true
                                    }
                                ]
                            },
                            "onerror": [
                                {
                                    "id": 10,
                                    "module": "builtin:Ignore",
                                    "version": 1,
                                    "metadata": {
                                        "designer": {
                                            "x": 644,
                                            "y": -542,
                                            "name": "On Error: Ignore"
                                        }
                                    }
                                }
                            ]
                        },
                        {
                            "id": 8,
                            "module": "sendinblue:CreateContact",
                            "version": 2,
                            "parameters": {
                                "__IMTCONN__": 4786577
                            },
                            "mapper": {
                                "email": "{{4.data.email_address}}",
                                "listIds": [
                                    6
                                ],
                                "attributes": {
                                    "EXT_ID": "{{6.tenant_id}}/{{6.catalogue_number}}",
                                    "VORNAME": "{{6.first_name}}",
                                    "NACHNAME": "{{6.last_name}}"
                                },
                                "updateEnabled": true
                            },
                            "metadata": {
                                "designer": {
                                    "x": 968,
                                    "y": -238
                                },
                                "restore": {
                                    "expect": {
                                        "listIds": {
                                            "mode": "chose",
                                            "label": [
                                                "Make.com Test"
                                            ]
                                        },
                                        "updateEnabled": {
                                            "mode": "chose"
                                        },
                                        "smsBlacklisted": {
                                            "mode": "chose"
                                        },
                                        "emailBlacklisted": {
                                            "mode": "chose"
                                        },
                                        "smtpBlacklistSender": {
                                            "mode": "chose"
                                        }
                                    },
                                    "parameters": {
                                        "__IMTCONN__": {
                                            "data": {
                                                "scoped": "true",
                                                "connection": "sendinblue2"
                                            },
                                            "label": "Brevo"
                                        }
                                    }
                                },
                                "parameters": [
                                    {
                                        "name": "__IMTCONN__",
                                        "type": "account:sendinblue2",
                                        "label": "Connection",
                                        "required": true
                                    }
                                ],
                                "expect": [
                                    {
                                        "name": "email",
                                        "type": "email",
                                        "label": "Email"
                                    },
                                    {
                                        "name": "attributes",
                                        "spec": [
                                            {
                                                "name": "NACHNAME",
                                                "type": "text"
                                            },
                                            {
                                                "name": "VORNAME",
                                                "type": "text"
                                            },
                                            {
                                                "name": "SMS",
                                                "type": "text"
                                            },
                                            {
                                                "name": "WHATSAPP",
                                                "type": "text"
                                            },
                                            {
                                                "name": "LANDLINE_NUMBER",
                                                "type": "text"
                                            },
                                            {
                                                "name": "EXT_ID",
                                                "type": "text"
                                            },
                                            {
                                                "name": "CONTACT_TIMEZONE",
                                                "type": "text"
                                            },
                                            {
                                                "name": "JOB_TITLE",
                                                "type": "text"
                                            },
                                            {
                                                "name": "LINKEDIN",
                                                "type": "text"
                                            }
                                        ],
                                        "type": "collection",
                                        "label": "Attributes"
                                    },
                                    {
                                        "name": "listIds",
                                        "type": "select",
                                        "label": "Lists",
                                        "multiple": true
                                    },
                                    {
                                        "name": "emailBlacklisted",
                                        "type": "boolean",
                                        "label": "Email blacklisted"
                                    },
                                    {
                                        "name": "smsBlacklisted",
                                        "type": "boolean",
                                        "label": "SMS blacklisted"
                                    },
                                    {
                                        "name": "updateEnabled",
                                        "type": "boolean",
                                        "label": "Update enabled"
                                    },
                                    {
                                        "name": "smtpBlacklistSender",
                                        "spec": {
                                            "name": "value",
                                            "type": "text"
                                        },
                                        "type": "array",
                                        "label": "SMTP blacklist sender"
                                    }
                                ]
                            },
                            "onerror": [
                                {
                                    "id": 9,
                                    "module": "builtin:Ignore",
                                    "version": 1,
                                    "metadata": {
                                        "designer": {
                                            "x": 976,
                                            "y": -543,
                                            "name": "On Error: Ignore"
                                        }
                                    }
                                }
                            ]
                        }
                    ]
                },
                {
                    "flow": [
                        {
                            "id": 11,
                            "module": "sendinblue:DeleteContact",
                            "version": 2,
                            "parameters": {
                                "__IMTCONN__": 4786577
                            },
                            "filter": {
                                "name": "Unsubscribe",
                                "conditions": [
                                    [
                                        {
                                            "a": "{{4.event}}",
                                            "o": "text:equal",
                                            "b": "newsletter:unsubscribe"
                                        }
                                    ]
                                ]
                            },
                            "mapper": {
                                "email": "{{4.data.email_address}}"
                            },
                            "metadata": {
                                "designer": {
                                    "x": 648,
                                    "y": 130
                                },
                                "restore": {
                                    "parameters": {
                                        "__IMTCONN__": {
                                            "data": {
                                                "scoped": "true",
                                                "connection": "sendinblue2"
                                            },
                                            "label": "Brevo"
                                        }
                                    }
                                },
                                "parameters": [
                                    {
                                        "name": "__IMTCONN__",
                                        "type": "account:sendinblue2",
                                        "label": "Connection",
                                        "required": true
                                    }
                                ],
                                "expect": [
                                    {
                                        "name": "email",
                                        "type": "email",
                                        "label": "Email address",
                                        "required": true
                                    }
                                ]
                            },
                            "onerror": [
                                {
                                    "id": 12,
                                    "module": "builtin:Ignore",
                                    "version": 1,
                                    "metadata": {
                                        "designer": {
                                            "x": 656,
                                            "y": 431,
                                            "name": "On Error: Ignore"
                                        }
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "metadata": {
        "instant": true,
        "version": 1,
        "scenario": {
            "roundtrips": 1,
            "maxErrors": 3,
            "autoCommit": true,
            "autoCommitTriggerLast": true,
            "sequential": false,
            "slots": null,
            "confidential": false,
            "dataloss": false,
            "dlq": false,
            "freshVariables": false
        },
        "designer": {
            "orphans": []
        },
        "zone": "eu2.make.com",
        "notes": []
    }
}
