Global Unsubscribe / Blacklist

Discussion in 'General discussions' started by ART-Marketer, Oct 3, 2018.

  1. ART-Marketer

    ART-Marketer New Member

    Joined:
    Apr 22, 2016
    Messages:
    26
    Likes Received:
    1
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    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?
     
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,048
    Likes Received:
    2,344
  3. ART-Marketer

    ART-Marketer New Member

    Joined:
    Apr 22, 2016
    Messages:
    26
    Likes Received:
    1
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    Thanks. That should do what I was hoping to accomplish.
     
  4. DigitalDitchDigger

    DigitalDitchDigger New Member

    Joined:
    Mar 14, 2019
    Messages:
    6
    Likes Received:
    0
    S.E:
    2019-09-09 21:58:15
    L.T:
    Regular
    L.C:
    2
    Is this page customizable? Assuming its dynamic in PHP, where should I look for this file to edit the content? Thanks in advance
     
  5. DigitalDitchDigger

    DigitalDitchDigger New Member

    Joined:
    Mar 14, 2019
    Messages:
    6
    Likes Received:
    0
    S.E:
    2019-09-09 21:58:15
    L.T:
    Regular
    L.C:
    2
    Found it > if anyone else is looking to customize the Block Address page of MailWizz you can find it under:


    apps/frontend/views/lists/block-address.php
     
  6. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,048
    Likes Received:
    2,344
    @DigitalDitchDigger - remember that if you edit that page, when you'll upgrade to a newer version of mailwizz, your changes will be gone.
    Here's the correct way to overwrite that file contents, using hooks which is safe for upgrades:
    Create the file apps/init-custom.php and put this in it:
    PHP:
    <?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();
    });
    And edit the form as you see fit.
     
  7. DigitalDitchDigger

    DigitalDitchDigger New Member

    Joined:
    Mar 14, 2019
    Messages:
    6
    Likes Received:
    0
    S.E:
    2019-09-09 21:58:15
    L.T:
    Regular
    L.C:
    2

Share This Page