Skip to content
Snippets Groups Projects
Select Git revision
  • project-update-bot-only
  • 7.x-1.x default
  • 3430292-d11_ready
  • 3430292-automated-drupal-11
  • 8.x-1.x
  • 8.x-1.3
  • 8.x-1.6
  • 8.x-1.5
  • 8.x-1.4
  • 8.x-1.3
  • 8.x-1.2
  • 8.x-1.1
  • 7.x-1.2
  • 7.x-1.1
  • 8.x-1.0
  • 7.x-1.0
  • 7.x-1.0-alpha2
  • 7.x-1.0-alpha1
18 results

epsilon_harmony-3430292

  • Open with
  • Download source code
  • Your workspaces

      A workspace is a virtual sandbox environment for your code in GitLab.

      No agents available to create workspaces. Please consult Workspaces documentation for troubleshooting.

  • Forked from project / epsilon_harmony
    14 commits ahead of the upstream repository.
    user avatar
    Project-Update-bot authored
    6dd07112
    History

    Epsilon Harmony Documentation

    Follow the below procedure to install and use the Epsilon Harmony Client module for Drupal 7.

    Installation

    Configuration

    • Go to /admin/config/epsilon_harmony/configurations and fill in all the required fields.
    • To add multiple message ID's from Epsilon -- API navigate to /admin/config/epsilon_harmony/message_configuration and add the desired message identifier along with the message ID received from the Epsilon Team.

    Usage

    In order to use the module, call Epsilon Harmony API service.

    Please use the following code to call the API.
    <?php
      $service = \Drupal::service('epsilon_harmony.api_service');
    ?>

    Method 1 (Create Record)

    To create a record pass the desired attributes in a key=>value pair.

    <?php
      $service = \Drupal::service('epsilon_harmony.api_service');
    
      $record = [];
      $record['CustomerKey'] = "<CustomerKey>";
      $record['FirstName'] = "<Firstname>";
      $record['LastName'] = "<Lastname>";
      $record['PreferredChannel'] = "<PreferredChannel>";
      $record['GlobalOptOutFlag'] = "<GlobalOptOutFlag>";
      $record['AddressLine1'] = "<AddressLine1>";
      ...etc
      $service->createRecord($record);
    ?>
    *Note* In the above request only "CustomerKey" is a mandatory attribute rest can be removed.

    Method 2 (Update Record)

    To update a record pass the desired attributes in a key=>value pair.

    <?php
      $service = \Drupal::service('epsilon_harmony.api_service');
    
      $record = [];
      $record['CustomerKey'] = "<CustomerKey>";
      $record['FirstName'] = "<Firstname>";
      $record['LastName'] = "<Lastname>";
      $record['PreferredChannel'] = "<PreferredChannel>";
      $record['GlobalOptOutFlag'] = "<GlobalOptOutFlag>";
      $record['AddressLine1'] = "<AddressLine1>";
      ...etc
      $service->updateRecord($record);
    ?>
    *Note* In the above request only "CustomerKey" is a mandatory attribute rest can be removed.

    Method 3 (Delete Record)

    To delete a record pass customer key.

    <?php
      $service = \Drupal::service('epsilon_harmony.api_service');
      $service->deleteRecord(<CustomerKey>);
    ?>
    *Note* In the above request only "CustomerKey" is a mandatory.

    Method 4 (Retrieve Record)

    To retrieve a record pass customer key.

    <?php
      $service = \Drupal::service('epsilon_harmony.api_service');
      $service->retrieveRecord(<CustomerKey>);
    ?>
    *Note* In the above request only "CustomerKey" is a mandatory.

    Method 5 (Send a Message)

    To send a Email via Epsilon Harmony first add the desired message key(received) from Epsilon in the admin/config/epsilon_harmony/message_configuration. In the above form you can add multiple message ID's and trigger the API by passing the respective message identifier.

    <?php
      $service = \Drupal::service('epsilon_harmony.api_service');
    
      $record = [];
      $record['subjectOverride'] = "<Override if necessary not a required attribute>";
      $record['recipients'][] = array(
        "customerKey" => "<CustomerKey>",
        "emailAddress" => "<Email ID>",
        'attributes' => [
          array(
            'attributeName' => "FIRST_NAME",
            'attributeType' => "String",
            'attributeValue' => "<FirstName>",
          ),
          array(
            'attributeName' => "LAST_NAME",
            'attributeType' => "String",
            'attributeValue' => "<LastName>",
          )
          ...etc
        ]
      );
      $service->sendMessage("<message-identifier>", $record);
    ?>
    *Note* In the above request only "customerKey" and "emailAddress" are mandatory attributes rest can be removed.

    Method 6 (Create List Record)

    To create a record pass the desired attributes in a key=>value pair.

    <?php
      $service = \Drupal::service('epsilon_harmony.api_service');
    
      $record = [];
      $record['CustomerKey'] = "<CustomerKey>";
      $record['FirstName'] = "<Firstname>";
      $record['LastName'] = "<Lastname>";
      $record['PreferredChannel'] = "<PreferredChannel>";
      $record['GlobalOptOutFlag'] = "<GlobalOptOutFlag>";
      $record['AddressLine1'] = "<AddressLine1>";
      ...etc
      $service->createListRecord($record, <list_id>);
    ?>
    *Note* In the above request only "CustomerKey" is a mandatory attribute rest can be removed.

    Method 7 (Update List Record)

    To create a record pass the desired attributes in a key=>value pair.

    <?php
      $service = \Drupal::service('epsilon_harmony.api_service');
    
      $record = [];
      $record['CustomerKey'] = "<CustomerKey>";
      $record['FirstName'] = "<Firstname>";
      $record['LastName'] = "<Lastname>";
      $record['PreferredChannel'] = "<PreferredChannel>";
      $record['GlobalOptOutFlag'] = "<GlobalOptOutFlag>";
      $record['AddressLine1'] = "<AddressLine1>";
      ...etc
      $service->updateListRecord($record, <list_id>);
    ?>
    *Note* In the above request only "CustomerKey" is a mandatory attribute rest can be removed.

    Logging

    All the API triggers are logged in admin/config/epsilon_harmony/logs which can be used for debugging purpose.