<?php

/*
  MailBeez Automatic Trigger Email Campaigns
  http://www.mailbeez.com

  Copyright (c) 2010, 2011 MailBeez

  inspired and in parts based on
  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License

  rewrite emails to add tracking code

  $ga = new analyticsEconda('medium', 'campaign', 'source');
  $nInfo->content = $ga->rewriteContent($nInfo, 'content');

  // or
  $ga = new analyticsEconda($medium, $campaign, $source);
  $content = $ga->rewriteContent($content);
 */

///////////////////////////////////////////////////////////////////////////////
///																																					 //
///                 MailBeez Core file - do not edit                         //
///                                                                          //
///////////////////////////////////////////////////////////////////////////////

require_once(MH_DIR_FS_CATALOG . MH_ROOT_PATH . 'common/classes/analytics_base.php');

mh_define('MAILBEEZ_MAILHIVE_ECONDA_CAMPAIGN', null);

class analyticsEconda extends analyticsBase
{
    public $campaign;

// class constructor
    function __construct($campaign = MAILBEEZ_MAILHIVE_ECONDA_CAMPAIGN, $keyword = 'module')
    {
        // todo - params
        parent::__construct();
        $this->code = '';
        $this->campaign = $campaign . '/' . $keyword;
        $this->buildCode();
        $this->rewrite_format = mh_cfg('MAILBEEZ_MAILHIVE_ECONDA_REWRITE_FORMAT');

    }

    function buildCode()
    {
        // todo
        // https://support.econda.de/display/INDE/Kampagnen
        // http://www.example.com/index.php?campaign=MyCampaign

        // https://support.econda.de/display/INDE/Mailings#Mailings-Beispiele
        // http://www.myshop.com/abc/index.html?newsletter=2015_week12&ecmId=MAILING_ID&ecmUid=RECIPIENT_ID

        // MAILBEEZ_MAILHIVE_ECONDA_CAMPAIGN

        $this->code = 'newsletter=' . urlencode($this->campaign) ;
    }

}
