ART-Marketer
New Member
Is there a way to use a global unsubscribe / blacklist link in the mailwizz footer rather than having a user unsubscribe from a single list?
<?php
Yii::app()->hooks->addAction('before_view_file_content', function($viewCollection){
// hook only in frontend
if (!Yii::app()->apps->isAppName('frontend')) {
return;
}
// get the controller
$controller = $viewCollection->controller;
// make sure we're in the right controller and action
$isBlockAddressAction = $controller->id == 'lists' && $controller->action->id == 'block_address';
if (!$isBlockAddressAction) {
return;
}
// disable the output produced by mailwizz
$isBlockAddressAction->renderContent = false;
// and add out own output:
$form = $controller->beginWidget('CActiveForm'); ?>
<div class="box box-primary borderless">
<div class="box-header">
<div class="pull-left">
<h3 class="box-title"><?php echo IconHelper::make('envelope') . $controller->data->pageHeading;?></h3>
</div>
<div class="pull-right"></div>
<div class="clearfix"><!-- --></div>
</div>
<div class="box-body">
<div class="row">
<div class="col-lg-6">
<br />
<?php echo Yii::t('email_blacklist', '{app} is an email-marketing service that serves companies of all shapes and sizes.', array(
'{app}' => $controller->data->appName,
));?><br /><br />
<?php echo Yii::t('email_blacklist', 'With several users/companies sending campaigns to hundreds of millions of recipients, we\'re bound to get abuse reports. ');?>
<br />
<?php echo Yii::t('email_blacklist', 'We take abuse reports seriously, if you believe a customer is sending unsolicited and or spam email, please report abuse immediately.');?>
</div>
<div class="col-lg-6">
<div class="form-group">
<?php echo $form->labelEx($controller->data->model, 'email');?>
<?php echo $form->emailField($controller->data->model, 'email', $controller->data->model->getHtmlOptions('email')); ?>
<?php echo $form->error($controller->data->model, 'email');?>
</div>
<p>
<?php echo Yii::t('email_blacklist', 'By completing the form above you will permanently block your email address from receiving any email from {app} customers for the foreseeable future. This could also block genuine emails that you do want to receive from companies or websites that use our service.', array(
'{app}' => $controller->data->appName,
));?>
<br />
<?php echo Yii::t('email_blacklist', 'Please note, we will send you a confirmation email to make sure you are the owner of the email address!');?>
</p>
</div>
</div>
<div class="clearfix"><!-- --></div>
</div>
<div class="box-footer">
<div class="pull-right">
<button type="submit" class="btn btn-primary btn-flat"><?php echo IconHelper::make('next') . Yii::t('email_blacklist', 'Block my address');?></button>
</div>
<div class="clearfix"><!-- --></div>
</div>
</div>
<?php
$controller->endWidget();
});
Attempt to assign property "renderContent" on bool
<?php
Yii::app()->hooks->addAction('before_view_file_content', function($viewCollection){
// hook only in frontend
if (!Yii::app()->apps->isAppName('frontend')) {
return;
}
// get the controller
$controller = $viewCollection->controller;
// make sure we're in the right controller and action
$isBlockAddressAction = $controller->id == 'lists' && $controller->action->id == 'block_address';
if (!$isBlockAddressAction) {
return;
}
// disable the output produced by mailwizz
$viewCollection->renderContent = false;
// and add out own output:
$form = $controller->beginWidget('CActiveForm'); ?>
<div class="box box-primary borderless">
<div class="box-header">
<div class="pull-left">
<h3 class="box-title"><?php echo IconHelper::make('envelope') . $controller->data->pageHeading;?></h3>
</div>
<div class="pull-right"></div>
<div class="clearfix"><!-- --></div>
</div>
<div class="box-body">
<div class="row">
<div class="col-lg-6">
<br />
<?php echo Yii::t('email_blacklist', '{app} is an email-marketing service that serves companies of all shapes and sizes.', array(
'{app}' => $controller->data->appName,
));?><br /><br />
<?php echo Yii::t('email_blacklist', 'With several users/companies sending campaigns to hundreds of millions of recipients, we\'re bound to get abuse reports. ');?>
<br />
<?php echo Yii::t('email_blacklist', 'We take abuse reports seriously, if you believe a customer is sending unsolicited and or spam email, please report abuse immediately.');?>
</div>
<div class="col-lg-6">
<div class="form-group">
<?php echo $form->labelEx($controller->data->model, 'email');?>
<?php echo $form->emailField($controller->data->model, 'email', $controller->data->model->getHtmlOptions('email')); ?>
<?php echo $form->error($controller->data->model, 'email');?>
</div>
<p>
<?php echo Yii::t('email_blacklist', 'By completing the form above you will permanently block your email address from receiving any email from {app} customers for the foreseeable future. This could also block genuine emails that you do want to receive from companies or websites that use our service.', array(
'{app}' => $controller->data->appName,
));?>
<br />
<?php echo Yii::t('email_blacklist', 'Please note, we will send you a confirmation email to make sure you are the owner of the email address!');?>
</p>
</div>
</div>
<div class="clearfix"><!-- --></div>
</div>
<div class="box-footer">
<div class="pull-right">
<button type="submit" class="btn btn-primary btn-flat"><?php echo IconHelper::make('next') . Yii::t('email_blacklist', 'Block my address');?></button>
</div>
<div class="clearfix"><!-- --></div>
</div>
</div>
<?php
$controller->endWidget();
});