Upgrade to Pro — share decks privately, control downloads, hide ads and more …

でぶちゃんねる vol.27 EC-CUBE × MauticのAPI連携! / Integr...

でぶちゃんねる vol.27 EC-CUBE × MauticのAPI連携! / Integration with EC-CUBE and Mautic

More Decks by アクイアジャパン Acquia Japan

Other Decks in Programming

Transcript

  1. EC-CUBE × MauticͷAPI ࿈ܞʂEίϚʔεʹϞμϯ ͳWebϚʔέςΟϯάΛ ಋೖͯ͠ΈΑ͏ • EC-CUBEͱMauticͷ֓ཁ • EC-CUBEɺMauticͷڞ௨఺

    • ܨ͛ͯͰ͖Δ͜ͱ • ސ٬৘ใಉظσϞ • Q&A • ࣍ճ༧ࠂ ΞΫΠΞͷ։ൃऀ޲͚΢ΣϏφʔ ʮͰͿͪΌΜͶΔ ʯ
  2. • ʮۀքॳͷOpen DXPΛఏڙ͢Δʯ 
 ΞΫΠΞͷϏδϣϯΛ֦େ • MauticͷSaaS Campaign Studio Λఏڙ

    – ύϑΥʔϚϯεɺηΩϡϦςΟͳͲΞΫΠΞ͕୲ อ͠ػೳΛՃ͑ɺϚωʔδυαʔϏεͱͯ͠ఏڙ – ෳ਺ͷCampaign StudioΛ؅ཧ͢ΔϓϥοτϑΥʔ ϜʮCampaign FactoryʯͳͲͷಠࣗػೳ͋Γ ΞΫΠΞͱ Mautic ͷؔ܎ ΞΫΠΞ͸ Mautic ͷ࠷େͷίϯτϦϏϡʔλʔͰ͢
  3. Mautic ͰͰ͖Δ͜ͱ σʔλͷಉظͱηάϝϯςʔγϣϯ • ސ٬ɺ঎඼σʔλͷಉظ • ҰׅΠϯϙʔτ • ϑΟʔϧυʹΑΔಈతηάϝϯτ •

    ސ٬ͷεςʔδઃܭ • ϥϯσΟϯάϖʔδͱϑΥʔϜ࡞ ੒ ύʔιφϥΠζͱΩϟϯϖʔϯ • WebαΠττϥοΩϯά • είΞϦϯά • ಛผΫʔϙϯͷϙοϓΞοϓ • AʗBςετ • Χΰམͪϝʔϧ ϚϧννϟωϧରԠͷϝοηʔδ഑৴ • ηάϝϯτϝʔϧ഑৴ • ϚʔέςΟϯάϝʔϧ഑৴ • LINEɺSMS σʔλͷ෼ੳɺϨϙʔτ • Ϩϙʔτ࡞੒ • μογϡϘʔυͷΧελϚΠζ
  4. APIΛ࢖༻ͯ͠ɺEC-CUBE ⁶ MauticؒͰ 
 ސ٬৘ใΛಉظͯ͠ΈΑ͏ ࿈ܞσϞ – Mautic REST API,

    webhook – EC-CUBE Web API ϓϥάΠϯ, webhook – Node.jsαʔόʔ(heroku) https://github.com/hmaruyama/eccube-mautic-demoapp
  5. ࿈ܞσϞͷϑϩʔ ΫϥΠΞϯτ Node.jsαʔόʔ (heroku) EC-CUBE Mautic EC-CUBEαΠτ 
 Ͱձһొ࿥ ձһొ࿥ΛτϦΨʔʹ

    Webhook͕ൃՐ EC-CUBE GraphQL APIͰର ৅ͷސ٬৘ใΛऔಘ Mautic REST APIͰEC- CUBEͷސ٬৘ใΛૹ৴ POST /webhook/ec [{entity: customer, id: x, action: created}] success POST /api { customer(id:x) { id, name01, name02, email,company_name,phone_number }} {data: {customer: {id: x, name01: ؙࢁ, name02: … }}} POST /api/contacts/new {eccubecustomerid: x, lastname:ؙࢁ, firstname: … } success
  6. σϞΞϓϦͷղઆ EC-CUBEଆͰߦ͏͜ͱ 1. EC-CUBE Web API ϓϥάΠϯͷ༗ޮԽ 2. APIΫϨσϯγϟϧͷ৽ن࡞੒ 3.

    Webhookͷ৽ن࡞੒ MauticଆͰߦ͏͜ͱ 1. APIΫϨσϯγϟϧͷ৽ن࡞੒ 2. Webhookͷ৽ن࡞੒ ɾΫϥΠΞϯτID ɾΫϥΠΞϯτγʔΫϨοτ ɾwebhookγʔΫϨοτ Λ߇͓͑ͯ͘
  7. σϞΞϓϦͷղઆ # ϩʔΧϧ؀ڥʹϦϙδτϦΛΫϩʔϯ $ git clone [email protected]:hmaruyama/eccube-mautic-demoapp.git
 # Ϋϩʔϯͨ͠σΟϨΫτϦʹҠಈ $

    cd eccube-mautic-demoapp # herokuΞϓϦΛ৽ن࡞੒ (ࣄલʹheroku CLIΛΠϯετʔϧ͓ͯ͘͠) $ heroku creat e # ιʔείʔυΛherokuʹσϓϩΠ $ git push heroku master Node.jsαʔόʔͷ༻ҙʢherokuͷྫʣ ࠷ޙʹɺherokuͷμογϡϘʔυ͔Β.envͰ࢖༻͍ͯ͠Δ؀ڥม਺Λ࡞੒͢Δɻ
  8. ࢀর৘ใ – ৄࡉ͸ϒϩάهࣄʹͯ – https://www.acquia.com/jp/blog/the-sync-app-with-eccube-into-mautic – EC-CUBEެࣜαΠτ – https://www.ec-cube.net/ –

    EC-CUBE4 Web API ϓϥάΠϯ ։ൃυΩϡϝϯτ – https://doc.ec-cube.net/eccube-api4/ – MauticެࣜαΠτ – https://www.mautic.org/ – Mautic ։ൃऀ޲͚υΩϡϝϯτ – https://developer.mautic.org/
  9. EC-CUBE × MauticͷAPI ࿈ܞʂEίϚʔεʹϞμϯ ͳWebϚʔέςΟϯάΛ ಋೖͯ͠ΈΑ͏ • EC-CUBEͱMauticͷ֓ཁ • EC-CUBEɺMauticͷڞ௨఺

    • ܨ͛ͯͰ͖Δ͜ͱ • ސ٬৘ใಉظσϞ • Q&A • ࣍ճ༧ࠂ ΞΫΠΞͷ։ൃऀ޲͚΢ΣϏφʔ ʮͰͿͪΌΜͶΔ ʯ