{"id":7936,"date":"2023-08-30T09:21:55","date_gmt":"2023-08-30T08:21:55","guid":{"rendered":"https:\/\/help.cirrus-shield.com\/?post_type=docs&#038;p=7936"},"modified":"2023-10-30T12:24:29","modified_gmt":"2023-10-30T11:24:29","slug":"mailchimp","status":"publish","type":"docs","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/admin-guide\/plugins\/mailchimp\/","title":{"rendered":"Mailchimp"},"content":{"rendered":"\n<p class=\"has-luminous-vivid-amber-color has-text-color has-medium-font-size\"><strong>Introduction<\/strong><\/p>\n\n\n\n<p>This guide aims to walk you through the process of effectively integrate Mailchimp with Cirrus Shield.<\/p>\n\n\n\n<p class=\"has-luminous-vivid-amber-color has-text-color has-medium-font-size\"><strong>Prerequisites<\/strong><\/p>\n\n\n\n<p>Before you can start using the service, you will need to do the following steps:<\/p>\n\n\n\n<p><strong><em>In Mailchimp<\/em><\/strong><\/p>\n\n\n\n<p><strong>1. Create a Mailchimp Account<\/strong><\/p>\n\n\n\n<p>To get started, you will need to create a Mailchimp account. If you do not have one already, you can sign up by visiting the following link: <a href=\"https:\/\/mailchimp.com\/\">https:\/\/mailchimp.com\/<\/a><\/p>\n\n\n\n<p><strong>2. Obtain Your API Key<\/strong><\/p>\n\n\n\n<p>After successfully creating your Mailchimp account, the next step is to acquire your API key. This key will enable you to connect seamlessly with our service. To obtain your API key, follow these steps:<\/p>\n\n\n\n<p><strong>a. <strong>Access the API Key Management Page<\/strong><\/strong><\/p>\n\n\n\n<p>Click on the following link to access your Mailchimp account&#8217;s API key management page: <a href=\"https:\/\/us9.admin.mailchimp.com\/account\/api\/?_ga=2.224117659.1627744431.1691751332-217670292.1678692587\">https:\/\/us9.admin.mailchimp.com\/account\/api\/?_ga=2.224117659.1627744431.1691751332-217670292.1678692587<\/a><\/p>\n\n\n\n<p><strong>b. Generate a New API Key<\/strong><\/p>\n\n\n\n<p>Once on the API key management page, select the option to &#8220;Create A Key.&#8221; This will prompt you to provide a name for your API key.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"523\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-9.png\" alt=\"\" class=\"wp-image-7878\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-9.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-9-300x172.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-9-768x441.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p><strong>c. Retrieve and Save Your API Key<\/strong><\/p>\n\n\n\n<p>After naming your API key, the system will generate the key for you. It is crucial to copy and save this key in a secure location. You will need it during the configuration process<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"587\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-10.png\" alt=\"\" class=\"wp-image-7880\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-10.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-10-300x194.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-10-768x495.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"526\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-11.png\" alt=\"\" class=\"wp-image-7882\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-11.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-11-300x173.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-11-768x444.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p><strong><em>In Cirrus Shield<\/em><\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Install the Mailchimp Plugin :<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Start by navigating to the &#8220;Configuration&#8221; section in Cirrus Shield, then select &#8220;Extensions.&#8221; From there, install the Mailchimp plugin to enable the integration between the two platforms.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"542\" height=\"439\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-12.png\" alt=\"\" class=\"wp-image-7884\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-12.png 542w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-12-300x243.png 300w\" sizes=\"(max-width: 542px) 100vw, 542px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"852\" height=\"613\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-13.png\" alt=\"\" class=\"wp-image-7886\" style=\"width:840px;height:604px\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-13.png 852w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-13-300x216.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-13-768x553.png 768w\" sizes=\"(max-width: 852px) 100vw, 852px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"830\" height=\"603\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-14.png\" alt=\"\" class=\"wp-image-7888\" style=\"width:840px;height:603px\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-14.png 830w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-14-300x218.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-14-768x558.png 768w\" sizes=\"(max-width: 830px) 100vw, 830px\" \/><\/figure>\n\n\n\n<p><strong>2. <strong>Create Essential Objects: Contact, Lead, and Campaign :<\/strong> <\/strong><\/p>\n\n\n\n<p>To utilize the Mailchimp Plugin effectively, you need to ensure that at least one of the following objects is created: &#8220;Contact,&#8221; &#8220;Lead,&#8221; or &#8220;Campaign.&#8221; These objects require specific fields with designated types, particularly the crucial fields: &#8220;First_Name,&#8221; &#8220;Last_Name,&#8221; and &#8220;Email.&#8221; Refer to the image provided below for samples of the required fields.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"550\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-15.png\" alt=\"\" class=\"wp-image-7890\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-15.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-15-300x181.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-15-768x464.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p>Furthermore, it is essential to link the created campaign to the &#8220;Contact&#8221; and\/or &#8220;Lead&#8221; objects.<\/p>\n\n\n\n<p>To create an object, access &#8220;Configuration,&#8221; then choose &#8220;Objects,&#8221; and proceed to create the desired object.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"891\" height=\"341\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-16.png\" alt=\"\" class=\"wp-image-7892\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-16.png 891w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-16-300x115.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-16-768x294.png 768w\" sizes=\"(max-width: 891px) 100vw, 891px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"256\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-17.png\" alt=\"\" class=\"wp-image-7894\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-17.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-17-300x84.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-17-768x216.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p>After creating the object, go to \u201cChamps personnalis\u00e9s\u201d and create a new field, based on the fields that are shown in the image.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"492\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-18.png\" alt=\"\" class=\"wp-image-7896\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-18.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-18-300x162.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-18-768x415.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p><strong>N.B : Make sure to create the fields with the same name and same type of the images regarding the objects<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"664\" height=\"689\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-19.png\" alt=\"\" class=\"wp-image-7898\" style=\"width:840px;height:689px\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-19.png 664w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-19-289x300.png 289w\" sizes=\"(max-width: 664px) 100vw, 664px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"291\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-20.png\" alt=\"\" class=\"wp-image-7900\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-20.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-20-300x96.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-20-768x246.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p>It should be the same done for the rest of the fields based on their name and field types.<\/p>\n\n\n\n<p><strong>3. <strong>JavaScript Button<\/strong> :<\/strong><\/p>\n\n\n\n<p>Create a button for the object that you will be using with Mailchimp, the objects can be \u201cContact,\u201d \u201cLead\u201d or \u201cCampaign.\u201d To create a JavaScript button, navigate to Configuration -> Object -> Details -> Bouton Personnalis\u00e9s<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"375\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-21.png\" alt=\"\" class=\"wp-image-7902\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-21.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-21-300x124.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-21-768x316.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"516\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-22.png\" alt=\"\" class=\"wp-image-7904\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-22.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-22-300x170.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-22-768x435.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"171\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-23.png\" alt=\"\" class=\"wp-image-7906\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-23.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-23-300x56.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-23-768x144.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p>Then you create a button with the following information<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"579\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-24.png\" alt=\"\" class=\"wp-image-7908\" style=\"width:840px;height:534px\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-24.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-24-300x191.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-24-768x489.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p>Here will be the codes that you can use with each object respectively:<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Contact :<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function SendContactsBasedOnFilter()\n{\n    let TokenGUID = GetTokenID();\n    let orgInfo = new Object();\n    let userInfo = new Object();\n    \n    let list_name = document.getElementsByClassName(\"cuselText\")&#91;0].getElementsByTagName('label')&#91;0].innerHTML;\n    \n    let divElement = document.getElementById(\"divSubDataTablePartialListView0\")\n    let rows = divElement.querySelectorAll('tr');\n    let contactGUIDs = &#91;];\n    let contacts = &#91;];\n    let userLanguage = null;\n\n    $.ajax({\n        beforeSend: function (xhrObj) {\n            xhrObj.setRequestHeader(\"Accept\", \"application\/json\");\n        },\n        type: \"GET\",\n        async: false,\n        dataType: \"json\",\n        contentType: \"application\/json\",\n        url: \"\/RestApi\/Query?authToken=\" + TokenGUID + \"&amp;selectQuery=SELECT Name, Email, Language FROM User\",\n        success: function (Data) {\n            if (Data.Data != undefined) {\n                userInfo = Data.Data.User&#91;0];\nuserLanguage = userInfo.Language;\n            }\n            else {\n                userInfo = null;\n            }\n        },\n        error: function (XMLHttpRequest) {\n            alert(XMLHttpRequest.statusText);\n        }\n    });\n\n    rows.forEach(row =&gt; {\n        contactGUIDs.push(row.id);\n    });\n\n    contactGUIDs.shift();\n\n    contactGUIDs.forEach(GUID =&gt; {\n        var contact = GetDataByID(GUID,\"Contact\", \"First_Name, Last_Name, Email\");\n        contacts.push(contact);\n    });\n\nif(contacts == null || contacts.length === 0){\n var message = \"There are no contacts.\";\n if (userLanguage === \"fr\") {\n   message = \"Il n' y a pas de contacts.\";\n }\nalert(message);\nreturn;\n}\n\n    $.ajax({\n        beforeSend: function (xhrObj) {\n            xhrObj.setRequestHeader(\"Accept\", \"application\/json\");\n        },\n        type: \"GET\",\n        async: false,\n        dataType: \"json\",\n        contentType: \"application\/json\",\n        url: \"\/RestApi\/Query?authToken=\" + TokenGUID + \"&amp;selectQuery=SELECT Id, Name, Country, City, Street, PostalCode FROM Organization\",\n        success: function (Data) {\n            if (Data.Data != undefined) {\n                orgInfo = Data.Data.Organization&#91;0];\n                if (Data.Data.Organization&#91;0].Country == null) {\n                    orgInfo.Country = \"France\";\n                }\n            }\n            else {\n                orgInfo = null;\n            }\n        },\n        error: function (XMLHttpRequest) {\n            alert(XMLHttpRequest.statusText);\n        }\n    });\n\n    try {\n        var settings = {\n            \"url\": `https:\/\/mchmp.cirrus-shield.net\/Mailchimp?list_name=${list_name}`,\n            \"method\": \"POST\",\n            \"timeout\": 0,\n            \"headers\": {\n                \"Content-Type\": \"application\/json\"\n            },\n            \"data\": JSON.stringify({ \"Contacts\": contacts, \"User\": userInfo, \"Organization\": orgInfo }),\n            \"error\": function (XMLHttpRequest) {\n                alert(\"Error: \" + XMLHttpRequest.responseText);\n            }\n        };\n\n        $.ajax(settings)\n            .done(function (response) {\n                var message = \"Contacts have been successfully sent to Mailchimp.\";\nif(userLanguage === \"fr\"){\nmessage = \"Les contacts ont \u00e9t\u00e9 envoy\u00e9s \u00e0 Mailchimp avec succ\u00e8s\";\n}\n                alert(message);\n            });\n    } catch (error) {\n        console.log(error);\n        alert(response);\n    }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Lead :<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function SendLeadsBasedOnFilter()\n{\n    let TokenGUID = GetTokenID();\n    let orgInfo = new Object();\n    let userInfo = new Object();\n    \n    let list_name = document.getElementsByClassName(\"cuselText\")&#91;0].getElementsByTagName('label')&#91;0].innerHTML;\n    \n    let divElement = document.getElementById(\"divSubDataTablePartialListView0\")\n    let rows = divElement.querySelectorAll('tr');\n    let contactGUIDs = &#91;];\n    let contacts = &#91;];\n    let userLanguage = null;\n\n $.ajax({\n        beforeSend: function (xhrObj) {\n            xhrObj.setRequestHeader(\"Accept\", \"application\/json\");\n        },\n        type: \"GET\",\n        async: false,\n        dataType: \"json\",\n        contentType: \"application\/json\",\n        url: \"\/RestApi\/Query?authToken=\" + TokenGUID + \"&amp;selectQuery=SELECT Name, Email, Language FROM User\",\n        success: function (Data) {\n            if (Data.Data != undefined) {\n                userInfo = Data.Data.User&#91;0];\nuserLanguage  = userInfo.Language;\n            }\n            else {\n                userInfo = null;\n            }\n        },\n        error: function (XMLHttpRequest) {\n            alert(XMLHttpRequest.statusText);\n        }\n    });\n\n    rows.forEach(row =&gt; {\n        contactGUIDs.push(row.id);\n    });\n\n    contactGUIDs.shift();\n\n    contactGUIDs.forEach(GUID =&gt; {\n        var contact = GetDataByID(GUID,\"Lead\", \"First_Name, Last_Name, Email\");\n        contacts.push(contact);\n    });\n\nif(contacts == null || contacts.length === 0){\n var message = \"There are no leads.\";\n if (userLanguage === \"fr\") {\n   message = \"Il n' y a pas de prospects.\";\n }\nalert(message);\nreturn;\n}\n\n    $.ajax({\n        beforeSend: function (xhrObj) {\n            xhrObj.setRequestHeader(\"Accept\", \"application\/json\");\n        },\n        type: \"GET\",\n        async: false,\n        dataType: \"json\",\n        contentType: \"application\/json\",\n        url: \"\/RestApi\/Query?authToken=\" + TokenGUID + \"&amp;selectQuery=SELECT Id, Name, Country, City, Street, PostalCode FROM Organization\",\n        success: function (Data) {\n            if (Data.Data != undefined) {\n                orgInfo = Data.Data.Organization&#91;0];\n                if (Data.Data.Organization&#91;0].Country == null) {\n                    orgInfo.Country = \"France\";\n                }\n            }\n            else {\n                orgInfo = null;\n            }\n        },\n        error: function (XMLHttpRequest) {\n            alert(XMLHttpRequest.statusText);\n        }\n    });\n\n    try {\n        var settings = {\n            \"url\": `https:\/\/ mchmp.cirrus-shield.net \/Mailchimp?list_name=${list_name}`,\n            \"method\": \"POST\",\n            \"timeout\": 0,\n            \"headers\": {\n                \"Content-Type\": \"application\/json\"\n            },\n            \"data\": JSON.stringify({ \"Contacts\": contacts, \"User\": userInfo, \"Organization\": orgInfo }),\n            \"error\": function (XMLHttpRequest) {\n                alert(\"Error: \" + XMLHttpRequest.responseText);\nconsole.log(XMLHttpRequest);\n            }\n        };\n\n        $.ajax(settings)\n            .done(function (response) {\n              var message = \"Leads have been successfully sent to Mailchimp.\";\nif(userLanguage === \"fr\"){\nmessage = \"Les prospects ont \u00e9t\u00e9 envoy\u00e9s \u00e0 Mailchimp avec succ\u00e8s\";\n}\n                alert(message);\n            });\n    } catch (error) {\n        console.log(error);\n        alert(response);\n    }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong><strong>Campaign<\/strong>:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function SendCampaignMembers()\n{\n    var TokenGUID = GetTokenID();\n    var orgInfo = new Object();\n    var userInfo = new Object();\n    var test = document.querySelectorAll(\"#cell1id\");\n    var list_name = test&#91;0].textContent;\n    var contacts = &#91;];\n    var userLanguage = null;\n    var campaign_members = GetDataByColumn(\"Campaign\", GetRecordGUID(), \"Campaign_Member\", \"Name, Member\");\n\n$.ajax({\n        beforeSend: function (xhrObj) {\n            xhrObj.setRequestHeader(\"Accept\", \"application\/json\");\n        },\n        type: \"GET\",\n        async: false,\n        dataType: \"json\",\n        contentType: \"application\/json\",\n        url: \"\/RestApi\/Query?authToken=\" + TokenGUID + \"&amp;selectQuery=SELECT Name, Email, Language FROM User\",\n        success: function (Data) {\n            if (Data.Data != undefined) {\n                userInfo = Data.Data.User&#91;0];\n                userLanguage = userInfo.Language;\n            }\n            else {\n                userInfo = null;\n            }\n        },\n        error: function (XMLHttpRequest) {\n            alert(XMLHttpRequest.statusText);\n        }\n    });\n\n\n\n    if (campaign_members == null || campaign_members.length === 0) {\nvar message = \"There are no campaign members.\";\nif(userLanguage === \"fr\"){\nmessage = \"Il n'y a aucun membre de campagne.\";\n}\n        alert(message);\n        return;\n    }\n\n    campaign_members.forEach(element =&gt;\n    {\n        var contact = GetDataByID(element.Member, \"Contact\", \"First_Name, Last_Name, Email\");\n        if (contact == null)\n        {\n            contact = GetDataByID(element.Member, \"Lead\", \"First_Name, Last_Name, Email\");\n        }\n        contacts.push(contact);\n    });\n\n    $.ajax({\n        beforeSend: function (xhrObj) {\n            xhrObj.setRequestHeader(\"Accept\", \"application\/json\");\n        },\n        type: \"GET\",\n        async: false,\n        dataType: \"json\",\n        contentType: \"application\/json\",\n        url: \"\/RestApi\/Query?authToken=\" + TokenGUID + \"&amp;selectQuery=SELECT Id, Name, Country, City, Street, PostalCode FROM Organization\",\n        success: function (Data) {\n            if (Data.Data != undefined) {\n                orgInfo = Data.Data.Organization&#91;0];\n                if (Data.Data.Organization&#91;0].Country == null) {\n                    orgInfo.Country = \"France\";\n                }\n            }\n            else {\n                orgInfo = null;\n            }\n        },\n        error: function (XMLHttpRequest) {\n            alert(XMLHttpRequest.statusText);\n        }\n    });\n    \n    try {\n        var settings = {\n            \"url\": `https:\/\/mchmp.cirrus-shield.net\/Mailchimp?list_name=${list_name}`,\n            \"method\": \"POST\",\n            \"timeout\": 0,\n            \"headers\": {\n                \"Content-Type\": \"application\/json\"\n            },\n            \"data\": JSON.stringify({ \"Contacts\": contacts, \"User\": userInfo, \"Organization\": orgInfo }),\n            \"error\": function (XMLHttpRequest) {\n                alert(\"Error: \" + XMLHttpRequest.responseText);\n            }\n        };\n\n        $.ajax(settings)\n            .done(function (response) {\nvar message = \"Contacts have been successfully sent to Mailchimp.\";\nif(userLanguage === \"fr\"){\nmessage = \"Les contacts ont \u00e9t\u00e9 envoy\u00e9s \u00e0 Mailchimp avec succ\u00e8s\";\n}\n                alert(message);\n            });\n    } catch (error) {\n        console.log(error);\n        alert(response);\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>And then make sure to change the visibility of the button based on the users that will be using it, you can do this by going to the object where you created the button -&gt; button details -&gt; Profils<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"158\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-25.png\" alt=\"\" class=\"wp-image-7910\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-25.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-25-300x52.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-25-768x133.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"321\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-26.png\" alt=\"\" class=\"wp-image-7912\" style=\"width:840px;height:296px\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-26.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-26-300x106.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-26-768x271.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"263\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-27.png\" alt=\"\" class=\"wp-image-7914\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-27.png 910w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-27-300x87.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-27-768x222.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p>And finally you will be able to see the button in the details page of the record of the specific chosen object<\/p>\n\n\n\n<p class=\"has-luminous-vivid-amber-color has-text-color has-medium-font-size\"><strong>Configuration <\/strong><\/p>\n\n\n\n<p>To configure the plugin that you installed, you\u2019ll have to go to the details of the Mailchimp installed plugin.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"405\" src=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-28-1024x405.png\" alt=\"\" class=\"wp-image-7916\" srcset=\"https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-28-1024x405.png 1024w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-28-300x119.png 300w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-28-768x303.png 768w, https:\/\/help.cirrus-shield.com\/wp-content\/uploads\/2023\/08\/image-28.png 1035w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This will direct you to the configuration page. Initiate the configuration process by entering your Cirrus Shield credentials (Username &amp; Password) and your Mailchimp credentials (Access Token). After inputting the necessary information, click &#8220;Create&#8221; to save the configuration to Cirrus Shield.<\/p>\n","protected":false},"author":12,"featured_media":0,"parent":1363,"menu_order":5,"comment_status":"open","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"doc_tag":[],"class_list":["post-7936","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/7936","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/comments?post=7936"}],"version-history":[{"count":2,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/7936\/revisions"}],"predecessor-version":[{"id":8562,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/7936\/revisions\/8562"}],"up":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/1363"}],"next":[{"title":"Sirene","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/admin-guide\/plugins\/sirene\/","href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/8009"}],"prev":[{"title":"Email Template","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/admin-guide\/plugins\/email-template\/","href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/7854"}],"wp:attachment":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/media?parent=7936"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/doc_tag?post=7936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}