Logotipo Help Portal
  • Primeros Pasos

    Introduction

    • Onboarding overview
    • Project Initiation
    • Email compliance
    • Gestión de Cuentas

    Datos

    • Intercambio de datos
    • Embarque de datos
    • Web data collection

    Channels

    • Email onboarding
    • Smart Insight
    • Predict
  • Vídeos formativos
    • Online Self Learning
    • Vídeos de embarque
    • Instructor Led Training
    • Webinars
    • Seminars
  • Guías de usuario

    Estrategia

    • Personalización
    • Automatización
    • Data Monitoring

    Channels

    • Email
    • Apps para móviles
    • Web
    • Ads

    Add-ons

    • Smart Insight
    • Predict
    • Recomendación de Incentivos
    • AIM
  • Artículos de apoyo

    Novedades

    • ¿Qué hay de nuevo en la Plataforma de Emarsys?
    • Funciones Piloto
    • Artículos sobre Protección de Datos y GDPR
    • Release notes - archive

    Support

    • ¿Cómo puedo obtener ayuda?
    • Edita un Perfil de Usuario
  • |
  • Desarrolladores
  • Estado del sistema
Necesita ayuda? Enviar una solicitud
Español Deutsch English Français Русский Türkçe 简体中文
Iniciar sesión
  • Documentation_-TechRef_- Enhance Add-ons
  • Emarsys Integration Platform
  • 0 Documentation_-TechRef_- Enhance Add-ons Emarsys Integration Platform

En esta sección

  • The Enhance Marketplace
  • Add-ons - Overview
  • Integration How-to
  • Emarsys Partner API
  • Emarsys UI Framework
  • Integrating iframes for Single Sign-on
  • Containers
  • Javascript Events
  • Server-side Events
  • Integrating Automation Center Nodes
  • Más información

in Emarsys42

    Expand all

    Javascript Events

    Updated: 16 de enero de 2018 18:51

    Lo sentimos. Esta página no ha aún traducida. No se preocupe, el equipo localización de Emarsys está trabajando duro para proporcionarle toda la documentación en su idioma!

    For some use cases, a Single Sign-on iframe or a Containers iframe should communicate with the Emarsys application. We are using window.postMessage() to implement this communication. Our code that receives your integration’s messages is open source and available on GitHub at emartech/suite-integration-js.

    It’s possible that there will be more than one integration iframes will be loaded on a page. The iframes of Single Sign-on and Containers will receive an integration_instance_id GET parameter in the iframe URL. They can use this ID to identify themselves.

    Resize message

    Containers may have different heights based on the content they have, and this can change dynamically if the content changes. On the load of the content and content changes, the integration should send a resize message with the new height of the content.

    var integration_instance_id = document.location.href.match(/integration_instance_id=(d+)/)[1];
    window.postMessage({
      "event": "resize",
      "source": { "integration_instance_id": integration_instance_id },
      "height": 200 /* pixel */
    }, "*");

    Refresh message

    This message simply reloads the current page.

    var integration_instance_id = document.location.href.match(/integration_instance_id=(d+)/)[1];
    window.postMessage({
      "event": "refresh",
      "source": { "integration_instance_id": integration_instance_id }
    }, "*");

    Alert message

    The integration can send an alert event to the Emarsys application, and it will display a banner alert at the top of the page. The text of the alert message is required, and optionally you can specify an icon, a CSS classname and a timeout as well. Please refer to the Emarsys UI Framework for more information about the available icons and alert classes.

    var integration_instance_id = document.location.href.match(/integration_instance_id=(d+)/)[1];
    window.postMessage({
      "event": "alert",
      "source": { "integration_instance_id": integration_instance_id },
      "icon": "e-communication-network",
      "text": "Hello World!",
      "className": "e-alert-success"
    }, "*");

    Navigate message

    The integration can ask the Emarsys application to navigate to an other page. Please consult Emarsys Support about the available page IDs.

    var integration_instance_id = document.location.href.match(/integration_instance_id=(d+)/)[1];
    window.postMessage({
      "event": "navigate",
      "source": { "integration_instance_id": integration_instance_id },
      "target": {
        "pathname": "email_campaigns/edit",
        "campaign_id": 123456
      }
    }, "*");
    ¿Fue útil este artículo?

    ¿Tiene más preguntas? Enviar una solicitud
    Regresar al inicio

    You may also be interested in:

    Artículos relacionados

    • Server-side Events
    • Data Collection JavaScript API Reference
    • Emarsys Partner API
    • Salesforce CRM Integration Manual
    • Implementación de los scripts de compilación de datos de Web Extend
    Copyright © 2019 Emarsys eMarketing Systems. All rights reserved
    Legal Notice Privacy Policy Master Services Agreement Anti-spam Policy
    test new search