Plugin Directory

Changeset 2113611


Ignore:
Timestamp:
06/27/2019 12:45:51 PM (7 years ago)
Author:
ehsantikweb
Message:

Message expired bounce emails will now consider as mailbox not available function added, tagging 1.3.14

Location:
bounce-handler-mailpoet
Files:
5 edited
8 copied

Legend:

Unmodified
Added
Removed
  • bounce-handler-mailpoet/trunk/bounce-handler-mailpoet.php

    r2112545 r2113611  
    66 * Plugin Name:       Bounce Handler Mailpoet
    77 * Description:       Bounce Handler Mailpoet is an add-on for MailPoet 3 to handle bounce emails easily, when using your own SMTP server.
    8  * Version:           1.3.14
     8 * Version:           1.3.15
    99 * Author:            Tikweb
    1010 * Author URI:        http://www.tikweb.dk/
  • bounce-handler-mailpoet/trunk/changelog.txt

    r2112545 r2113611  
    11== Changelog ==
     2
     3= 1.3.15 - 2019-06-27 =
     4* Added: Message expired bounce emails will now consider as mailbox not available
    25
    36= 1.3.14 - 2019-06-25 =
  • bounce-handler-mailpoet/trunk/includes/class-mailpoet-bounce-detect.php

    r2112545 r2113611  
    674674                    "name" => __('Mailbox not available', 'bounce-handler-mailpoet'),
    675675                    "title" => __('When mailbox is not available', 'bounce-handler-mailpoet'),
    676                     "regex" => '(Invalid|no such|unknown|bad|des?activated|undelivered|inactive|unrouteable|delivery|mail ID|failed to|may not|no known user|email account) *(mail|destination|recipient|user|address|person|failure|has failed|does not exist|deliver to|exist|with this email|is closed)|RecipNotFound|status(-code)? *(:|=)? *5\.(1\.[1-6]|0\.0|4\.[0123467])|(user|mailbox|address|recipients?|host|account|domain) *(is|has been)? *(error|disabled|failed|unknown|unavailable|not *(found|available)|.{1,30}inactiv)|recipient *address *rejected|does *not *like *recipient|no *mailbox *here|user does.?n.t have.{0,20}account'
     676                    "regex" => 'expired|(Invalid|no such|unknown|bad|des?activated|undelivered|inactive|unrouteable|delivery|mail ID|failed to|may not|no known user|email account) *(mail|destination|recipient|user|address|person|failure|has failed|does not exist|deliver to|exist|with this email|is closed)|RecipNotFound|status(-code)? *(:|=)? *5\.(1\.[1-6]|0\.0|4\.[0123467])|(user|mailbox|address|recipients?|host|account|domain) *(is|has been)? *(error|disabled|failed|unknown|unavailable|not *(found|available)|.{1,30}inactiv)|recipient *address *rejected|does *not *like *recipient|no *mailbox *here|user does.?n.t have.{0,20}account'
    677677                ],
    678678                [
  • bounce-handler-mailpoet/trunk/includes/class-mailpoet-bounce-handler.php

    r2112545 r2113611  
    404404                                    <input id="bounce[spammer_forward]" size="30" type="text" name="bounce[spammer_forward]" value="<?php $this->show_value($bounce['spammer_forward']); ?>">
    405405                                </li>
    406 
    407 
    408 
    409 
    410 
    411406                                <li>
    412                                     <label for="bounce[weird_forward]"><?php _e("When the bounce is weird and we're not sure what to do", 'bounce-handler-mailpoet'); ?>: </label>
    413 
    414                                         <?php $wfa_cond = isset($bounce['wfa_cond']) ? $bounce['wfa_cond'] : ''; ?>
    415     <select name="bounce[wfa_cond]" id="bounce[wfa_cond]">
    416         <option value='forward_email' <?php selected($wfa_cond, 'forward_email'); ?> ><?php _e('Forward to', 'bounce-handler-mailpoet'); ?></option>
    417         <option value="do_nothing" <?php selected($wfa_cond, ''); ?> ><?php _e('Do nothing', 'bounce-handler-mailpoet'); ?></option>
    418         <option value="delete" <?php selected($wfa_cond, 'delete'); ?> ><?php _e('Delete the user', 'bounce-handler-mailpoet'); ?></option>
    419         <option value="bounced" <?php selected($wfa_cond, 'bounced'); ?> ><?php _e('Change status to \'Bounced\'', 'bounce-handler-mailpoet'); ?></option>
    420         <option value="unsub" <?php selected( $wfa_cond, 'unsub' ); ?>>Unsubscribe The User</option>
    421         <option value="wfa_addOrRemove" <?php selected( $wfa_cond, 'wfa_addOrRemove' ); ?>><?php _e('Disregard current list','bounce-handler-mailpoet'); ?></option>
    422     </select>
    423     <?php $wfa_add_remove = isset($bounce['wfa_add_remove']) ? $bounce['wfa_add_remove'] : 'do_nothing'; ?>
    424     <span class="hidden" id="wfa-unsub-wraper">
    425         <?php _e('and','bounce-handler-mailpoet');?>
    426         <select name="bounce[wfa_add_remove]" id="bounce[wfa_add_remove]">
    427             <option value="add" <?php selected( $wfa_add_remove,'add' ); ?>><?php _e('Add','bounce-handler-mailpoet');?></option>
    428             <option value="remove" <?php selected( $wfa_add_remove,'remove' ); ?>><?php _e('Remove','bounce-handler-mailpoet');?></option>
    429             <option value="do_nothing" <?php selected( $wfa_add_remove,'do_nothing' ); ?>><?php _e('Do nothing more','bounce-handler-mailpoet');?></option>
    430         </select>
    431         <span id="wfa-hide-on-nothing">
    432             <?php $wfa_list = isset($bounce['wfa_list']) ? $bounce['wfa_list'] : ''; ?>
    433             <?php _e('him for the list','bounce-handler-mailpoet');?>
    434             <select name="bounce[wfa_list]" id="bounce[wfa_list]">
    435                 <?php
    436                     $sagments = Segment::getPublic()->findArray();
    437                     if(!empty($sagments)): foreach($sagments as $sagment):
    438                 ?>
    439                 <option value="<?php echo $sagment['id'];?>" <?php selected( $wfa_list,$sagment['id'] ); ?>><?php echo $sagment['name'];?></option>
    440                 <?php endforeach;?>
    441                 <?php else : ?>
    442                     <option value="1"><?php _e('No List Found','bounce-handler-mailpoet');?></option>
    443                 <?php endif; ?>
    444             </select>
    445             <?php $wfa_status = isset($bounce['wfa_status']) ? $bounce['wfa_status'] : ''; ?>
    446             <?php _e('as','bounce-handler-mailpoet');?>
    447             <select name="bounce[wfa_status]" id="bounce[wfa_status]">
    448                 <option value="subs" <?php selected( $wfa_status,'subs' );?>><?php _e('Subscriber','bounce-handler-mailpoet');?></option>
    449                 <option value="bounced" <?php selected( $wfa_status,'bounced' );?>><?php _e('Bounced','bounce-handler-mailpoet');?></option>
    450                 <option value="unconfirmed" <?php selected( $wfa_status,'unconfirmed' );?>><?php _e('Unconfirmed','bounce-handler-mailpoet');?></option>
    451                 <option value="unsubs" <?php selected( $wfa_status,'unsubs' );?>><?php _e('Unsubscriber','bounce-handler-mailpoet');?></option>
    452             </select>
    453         </span>
    454     </span>
    455 
    456 
    457                                     <span id="bouncefwa"><input id="bounce[weird_forward]" required size="30" type="text" class="" name="bounce[weird_forward]" value="<?php $this->show_value($bounce['weird_forward']); ?>"></span>
     407                                    <label for="bounce[weird_forward]"><?php _e("When the bounce is weird and we're not sure what to do, forward to", 'bounce-handler-mailpoet'); ?>: </label>
     408                                    <input id="bounce[weird_forward]" size="30" type="text" class="" name="bounce[weird_forward]" value="<?php $this->show_value($bounce['weird_forward']); ?>">
    458409                                </li>
    459410                            </ol>
     
    625576
    626577                    //Valide weird not sure Email
    627 //                  if(!is_email($bounce['weird_forward'])){
    628 //                      $error[] = __("Please set a valid email address for forward rules when the bounce is weird and we're not sure what to do.","bounce-handler-mailpoet");
    629 //                      $error[] = 'weird_forward';
    630 //                  }
     578                    if(!is_email($bounce['weird_forward'])){
     579                        $error[] = __("Please set a valid email address for forward rules when the bounce is weird and we're not sure what to do.","bounce-handler-mailpoet");
     580                        $error[] = 'weird_forward';
     581                    }
    631582
    632583                    //Email validate if
     
    675626                            }
    676627                        }
    677 
    678 
    679                         if ( ($bounce['wfa_cond'] == 'wfa_addOrRemove' || $bounce['wfa_cond'] == 'unsub') && $bounce['wfa_add_remove'] !='do_nothing' ){
    680                             $bounce['weird_forward'] = array(
    681                                 'cond' => $bounce['wfa_cond'],
    682                                 'add_remove' => $bounce['wfa_add_remove'],
    683                                 'list' => $bounce['wfa_list'],
    684                                 'status' => $bounce['wfa_status'],
    685                             );
    686                         } else {
    687                             //execute below if statement only if user choose other option than forward email
    688                             if ('forward_email' != $bounce['wfa_cond']) {
    689                                 $bounce['weird_forward'] = $bounce['wfa_cond'];
    690                             }
    691                             if ( $bounce['wfa_cond'] != 'wfa_addOrRemove' ){
    692                                 foreach ($nested_cond as $key) {
    693                                     unset($bounce['wfa_'.$key]);
    694                                 }
    695                             }
    696                         }
    697 
    698 
    699 
    700628
    701629                        $bounce['last_updated'] = time();
     
    803731                    $(function() {
    804732
    805                         showHide_wfaForm();
    806733                        /**
    807734                         * Active settings tab
     
    843770                        });
    844771
    845                         var wfa_sel = $('select[name="bounce[wfa_cond]"]');
    846                         $(wfa_sel).on('change',function(){
    847                             showHide_UnsubWraper();
    848                             showHide_wfaForm();
    849                         });
    850 
    851 
    852 
    853772                        var mna_dn = $('select[name="bounce[mna_add_remove]"]');
    854773                        var mf_dn = $('select[name="bounce[mf_add_remove]"]');
    855                         var wfa_dn = $('select[name="bounce[wfa_add_remove]"]');
    856774
    857775                        $(mf_dn).on('change',function(){
     
    863781                        });
    864782
    865                         $(wfa_dn).on('change',function(){
    866                             showHide_DnWraper();
    867                         });
    868 
    869 
    870783                        function showHide_DnWraper(){
    871784
    872                             var mf_dn = $('select[name="bounce[mf_add_remove]"]');
     785                            var mna_dn = $('select[name="bounce[mna_add_remove]"]');
     786                            var mf_dn = $('select[name="bounce[mf_add_remove]"]');
     787
    873788                            if ( mf_dn.find(':selected').val() == 'do_nothing' ){
    874789                                $('span#mf-hide-on-nothing').addClass('hidden');
     
    877792                            }
    878793
    879 
    880                             var mna_dn = $('select[name="bounce[mna_add_remove]"]');
    881794                            if ( mna_dn.find(':selected').val() == 'do_nothing' ){
    882795                                $('span#mna-hide-on-nothing').addClass('hidden');
     
    885798                            }
    886799
    887 
    888                             var wfa_dn = $('select[name="bounce[wfa_add_remove]"]');
    889                             if ( wfa_dn.find(':selected').val() == 'do_nothing' ){
    890                                 $('span#wfa-hide-on-nothing').addClass('hidden');
    891                             } else {
    892                                 $('span#wfa-hide-on-nothing').removeClass('hidden');
    893                             }
    894800                        }
    895 
    896 //hehe
    897                         // if ($('select[name="bounce[mf_cond]"]').find(':selected').val() != 'forward_email') {
    898                         //     $('span#mf-unsub-wraper').addClass('hidden');
    899                         // }
    900801
    901802                        function showHide_UnsubWraper(){
     
    919820                            }
    920821
    921 
    922                             var wfa_sel = $('select[name="bounce[wfa_cond]"]');
    923 
    924                             if ( wfa_sel.find(':selected').val() == 'unsub' ||
    925                                  wfa_sel.find(':selected').val() == 'wfa_addOrRemove' ){
    926                                 $('span#wfa-unsub-wraper').removeClass('hidden');
    927                             }
    928                             else {
    929                                 $('span#wfa-unsub-wraper').addClass('hidden');
    930                             }
    931 
    932                         }
    933 
    934                         function showHide_wfaForm() {
    935                             var wfa_sel = $('select[name="bounce[wfa_cond]"]');
    936 
    937                             if (wfa_sel.find(':selected').val() != 'forward_email') {
    938                                 $('span#bouncefwa').addClass('hidden');
    939                                 $('#bouncefwa input[name="bounce[weird_forward]"]').removeAttr('required')
    940                                 $('#bouncefwa input[name="bounce[weird_forward]"]').removeAttr('value')
    941                             }
    942                              else {
    943                                 $('span#bouncefwa').removeClass('hidden');
    944                                 $('#bouncefwa input[name="bounce[weird_forward]"]').attr('required', 'required')
    945                             }
    946822                        }
    947823
  • bounce-handler-mailpoet/trunk/readme.txt

    r2112545 r2113611  
    66Tested up to: 5.2.2
    77Requires PHP: 5.6.0
    8 Stable tag: 1.3.14
     8Stable tag: 1.3.15
    99
    1010Automatic mail bounce handling for MailPoet 3 to handle bounce emails easily when using your own SMTP server.
Note: See TracChangeset for help on using the changeset viewer.