Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • MarketingController
  • Overview
  • Package
  • Class
  • Tree

Class MarketingController

Controller to handle creating and mailing campaigns.

CComponent
Extended by CBaseController
Extended by CController
Extended by X2Controller
Extended by x2base
Extended by MarketingController
Package: application\modules\marketing\controllers
Located at x2engine/protected/modules/marketing/controllers/MarketingController.php
Methods summary
public array
# behaviors( )

Returns a list of behaviors that this controller should behave as. The return value should be an array of behavior configurations indexed by behavior names. Each behavior configuration can be either a string specifying the behavior class or an array of the following structure:

'behaviorName'=>array(
    'class'=>'path.to.BehaviorClass',
    'property1'=>'value1',
    'property2'=>'value2',
)

Returns a list of behaviors that this controller should behave as. The return value should be an array of behavior configurations indexed by behavior names. Each behavior configuration can be either a string specifying the behavior class or an array of the following structure:

'behaviorName'=>array(
    'class'=>'path.to.BehaviorClass',
    'property1'=>'value1',
    'property2'=>'value2',
)

Note, the behavior classes must implement IBehavior or extend from CBehavior. Behaviors declared in this method will be attached to the controller when it is instantiated.

For more details about behaviors, see CComponent.

Returns

array
the behavior configurations (behavior name=>behavior configuration)

Overrides

x2base::behaviors()
public array
# accessRules( )

Returns the access rules for this controller. Override this method if you use the filterAccessControl accessControl filter.

Returns the access rules for this controller. Override this method if you use the filterAccessControl accessControl filter.

Returns

array
list of access rules. See CAccessControlFilter for details about rule specification.

Overrides

CController::accessRules()
public array
# actions( )

Returns a list of external action classes. Array keys are action IDs, and array values are the corresponding action class in dot syntax (e.g. 'edit'=>'application.controllers.article.EditArticle') or arrays representing the configuration of the actions, such as the following,

return array(
    'action1'=>'path.to.Action1Class',
    'action2'=>array(
        'class'=>'path.to.Action2Class',
        'property1'=>'value1',
        'property2'=>'value2',
    ),
);

Derived classes may override this method to declare external actions.

Returns a list of external action classes. Array keys are action IDs, and array values are the corresponding action class in dot syntax (e.g. 'edit'=>'application.controllers.article.EditArticle') or arrays representing the configuration of the actions, such as the following,

return array(
    'action1'=>'path.to.Action1Class',
    'action2'=>array(
        'class'=>'path.to.Action2Class',
        'property1'=>'value1',
        'property2'=>'value2',
    ),
);

Derived classes may override this method to declare external actions.

Note, in order to inherit actions defined in the parent class, a child class needs to merge the parent actions with child actions using functions like array_merge().

You may import actions from an action provider (such as a widget, see CWidget::actions), like the following:

return array(
    ...other actions...
    // import actions declared in ProviderClass::actions()
    // the action IDs will be prefixed with 'pro.'
    'pro.'=>'path.to.ProviderClass',
    // similar as above except that the imported actions are
    // configured with the specified initial property values
    'pro2.'=>array(
        'class'=>'path.to.ProviderClass',
        'action1'=>array(
            'property1'=>'value1',
        ),
        'action2'=>array(
            'property2'=>'value2',
        ),
    ),
)

In the above, we differentiate action providers from other action declarations by the array keys. For action providers, the array keys must contain a dot. As a result, an action ID 'pro2.action1' will be resolved as the 'action1' action declared in the 'ProviderClass'.

Returns

array
list of external action classes

See

CController::createAction()

Overrides

x2base::actions()
public
# actionDeleteWebForm( integer $id )

Deletes a web form record with the specified id

Deletes a web form record with the specified id

Parameters

$id
integer
$id
public string
# actionGetItems( mixed $modelType )

Returns a JSON array of the names of all campaigns filtered by a search term.

Returns a JSON array of the names of all campaigns filtered by a search term.

Returns

string
A JSON array of strings
public
# actionView( integer $id )

Displays a particular model.

Displays a particular model.

Parameters

$id
integer
$id the ID of the model to be displayed
public
# actionViewContent( integer $id )

Displays the content field (email template) for a particular model.

Displays the content field (email template) for a particular model.

Parameters

$id
integer
$id the ID of the model to be displayed
public type
# loadModel( type $id )

Override of CommonControllerBehavior::loadModel(); expected behavior is in this case deference to the campaign model's Campagin::load() function.

Override of CommonControllerBehavior::loadModel(); expected behavior is in this case deference to the campaign model's Campagin::load() function.

Parameters

$id
type
$id

Returns

type
public
# actionCreate( )

Creates a new model. If creation is successful, the browser will be redirected to the 'view' page.

Creates a new model. If creation is successful, the browser will be redirected to the 'view' page.

public
# actionCreateFromTag( string $tag )

Create a campaign for all contacts with a certain tag.

Create a campaign for all contacts with a certain tag.

This action will create and save the campaign and redirect the user to edit screen to fill in the email message, etc. It is intended to provide a fast workflow from tags to campaigns.

Parameters

$tag
string
$tag
public
# actionUpdate( integer $id )

Updates a particular model. If update is successful, the browser will be redirected to the 'view' page.

Updates a particular model. If update is successful, the browser will be redirected to the 'view' page.

Parameters

$id
integer
$id the ID of the model to be updated
public
# actionDelete( integer $id )

Deletes a particular model. If deletion is successful, the browser will be redirected to the 'index' page.

Deletes a particular model. If deletion is successful, the browser will be redirected to the 'index' page.

Parameters

$id
integer
$id the ID of the model to be deleted
public
# actionIndex( )

Lists all models.

Lists all models.

public
# actionAdmin( )
public
# actionLaunch( integer $id )

Launches the specified campaign, activating it for mailing

Launches the specified campaign, activating it for mailing

When a campaign is created, it is specified with an existing contact list. When the campaign is lauched, this list is replaced with a duplicate to prevent the original from being modified, and to allow campaign specific information to be saved in the list. This includes the email send time, and the times when a contact has opened the mail or unsubscribed from the list.

Parameters

$id
integer
$id ID of the campaign to launch
public
# actionToggle( integer $id )

Deactivate a campaign to halt mailings, or resume paused campaign

Deactivate a campaign to halt mailings, or resume paused campaign

Parameters

$id
integer
$id The ID of the campaign to toggle
public
# actionComplete( integer $id )

Forcibly complete a campaign despite any unsent mail

Forcibly complete a campaign despite any unsent mail

Parameters

$id
integer
$id The ID of the campaign to complete
public
# actionMailIndividual( type $campaignId, type $itemId )

Sends an individual email to an item in a campaign/newsletter list.

Sends an individual email to an item in a campaign/newsletter list.

Parameters

$campaignId
type
$campaignId
$itemId
type
$itemId
public
# actionDoNotEmailLinkClick( mixed $x2_key )
public
# actionClick( integer $uid, string $type, string $url = null, string $email = null )

Track when an email is viewed, a link is clicked, or the recipient unsubscribes

Track when an email is viewed, a link is clicked, or the recipient unsubscribes

Campaign emails include an img tag to a blank image to track when the message was opened, an unsubscribe link, and converted links to track when a recipient clicks a link. All those links are handled by this action.

Parameters

$uid
integer
$uid The unique id of the recipient
$type
string
$type 'open', 'click', or 'unsub'
$url
string
$url For click types, this is the urlencoded URL to redirect to
$email
string
$email For unsub types, this is the urlencoded email address of the person unsubscribing
public
# actionRemoveWebLeadFormCustomHtml( )
public
# actionSaveWebLeadFormCustomHtml( )
public
# actionWebTracker( )

Get the web tracker code to insert into your website

Get the web tracker code to insert into your website

public
# insertMenu( array $selectOptions = array(), X2Model $model = null, array $menuParams = null )

Create a menu for Marketing

Create a menu for Marketing

Parameters

$selectOptions
array
Menu options to remove
$model
X2Model
Model object passed to the view
$menuParams
array
Additional menu parameters
Methods inherited from x2base
actionDeleteNote(), actionGetX2ModelInput(), actionQuickView(), actionSearch(), admin(), ajaxResponse(), appLockout(), beforeAction(), checkPermissions(), cleanUpTags(), convertUrls(), create(), decodeQuotes(), denied(), encodeQuotes(), filterSetPortlets(), filters(), getCurrentWorkflow(), getDetailView(), getHistory(), getModelFromTypeAndId(), getModelsFromTypeAndId(), getModuleObj(), getPageTitle(), getPhpMailer(), index(), mailingListToString(), parseEmailTo(), performAjaxValidation(), prepareMenu(), render(), renderLayout(), renderPartialAjax(), sendUserEmail(), setPageTitle(), throwException(), update(), view(), widget()
Methods inherited from X2Controller
badRequest(), badRequestException(), getBehaviorActions(), isAjaxRequest(), redirectToLogin(), resolveViewFile(), runBehaviorBeforeActionHandlers(), setFileFields(), validateMobileRequest()
Methods inherited from CController
__construct(), afterAction(), afterRender(), beforeRender(), clearPageStates(), createAbsoluteUrl(), createAction(), createActionFromMap(), createUrl(), filterAccessControl(), filterAjaxOnly(), filterPostOnly(), forward(), getAction(), getActionParams(), getCachingStack(), getClips(), getId(), getLayoutFile(), getModule(), getPageState(), getRoute(), getUniqueId(), getViewFile(), getViewPath(), init(), invalidActionParams(), isCachingStackEmpty(), loadPageStates(), missingAction(), processDynamicOutput(), processOutput(), recordCachingAction(), redirect(), refresh(), renderClip(), renderDynamic(), renderDynamicInternal(), renderPartial(), renderText(), replaceDynamicOutput(), run(), runAction(), runActionWithFilters(), savePageStates(), setAction(), setPageState()
Methods inherited from CBaseController
beginCache(), beginClip(), beginContent(), beginWidget(), createWidget(), endCache(), endClip(), endContent(), endWidget(), renderFile(), renderInternal()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Constants inherited from CController
STATE_INPUT_NAME
Properties summary
public string $modelClass 'Campaign'
#
Properties inherited from x2base
$actionMenu, $breadcrumbs, $layout, $leftPortlets, $leftWidgets, $menu, $noBackdrop, $portlets
Properties inherited from CController
$defaultAction
Magic properties inherited from CController
$action, $actionParams, $cachingStack, $clips, $id, $module, $pageTitle, $route, $uniqueId, $viewPath
X2CRM Documentation API documentation generated by ApiGen 2.8.0