Plugin Directory

Changeset 2463950


Ignore:
Timestamp:
01/27/2021 11:16:50 PM (5 years ago)
Author:
nellalink
Message:

EMAIL TEMPLATE PROPERLY FORMATTED

Location:
rimplenet/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • rimplenet/trunk/README.txt

    r2463683 r2463950  
    55Requires at least: 3.0.1
    66Tested up to: 5.6
    7 Stable tag: 1.1.2
     7Stable tag: 1.1.3
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    8080
    8181== Changelog ==
    82 = 1.1.2 =
     82= 1.1.3 =
    8383* Admin can now Credit or Debit User with a form on backend via WP-ADMIN-> SETTINGS: WALLET
    8484* Notification Email on Wallet Funds Additions or Withdrawal has been enabled.
     
    104104
    105105== Upgrade Notice ==
    106 = 1.1.2 =
     106= 1.1.3 =
    107107* Admin can now Credit or Debit User with a form on backend via WP-ADMIN-> SETTINGS: WALLET
    108108* Notification Email on Wallet Funds Additions or Withdrawal has been enabled.
  • rimplenet/trunk/includes/class-emails.php

    r2463673 r2463950  
    55    public function __construct() {
    66         
    7        add_action('after_add_user_mature_funds_to_wallet', array($this,'sendEmailNotification'), 10, 6 );
     7       add_action('after_add_user_mature_funds_to_wallet', array($this,'sendEmailNotification'), 10, 7 );
    88       
    99    }
    1010   
    11    function sendEmailNotification($txn_add_bal_id,$user_id,$amount_to_add,$wallet_id,$note,$tags)
     11   function sendEmailNotification($txn_add_bal_id,$user_id,$amount_to_add,$wallet_id,$note,$tags,$tnx_type)
    1212        {
    13          
     13         $txn_id = $txn_add_bal_id;
    1414         $wallet_obj = new Rimplenet_Wallets();
    1515         $all_wallets = $wallet_obj->getWallets();
    16    
     16         
     17         $user_wdr_bal = $wallet_obj->get_withdrawable_wallet_bal($user_id, $wallet_id);
     18         $user_non_wdr_bal = $wallet_obj->get_nonwithdrawable_wallet_bal($user_id, $wallet_id);
     19         $user_balance_total = $wallet_obj->get_total_wallet_bal($user_id,$wallet_id);
     20         
     21         $dec = $all_wallets[$wallet_id]['decimal'];
     22         $symbol = $all_wallets[$wallet_id]['symbol'];
     23         $symbol_position = $all_wallets[$wallet_id]['symbol_position'];
     24         if($symbol_position=='right'){
     25            $amount_formatted = number_format($amount_to_add,$dec)." ".$symbol;
     26            $user_wdr_bal_formatted = number_format($user_wdr_bal,$dec)." ".$symbol;
     27            $user_non_wdr_bal_formatted = number_format($user_non_wdr_bal,$dec)." ".$symbol;
     28            $user_balance_total_formatted = number_format($user_balance_total,$dec)." ".$symbol;
     29           
     30         }
     31        else{
     32            $amount_formatted = $symbol.number_format($amount_to_add,$dec);
     33            $user_wdr_bal_formatted  = $symbol.number_format($user_wdr_bal,$dec);
     34            $user_non_wdr_bal_formatted = $symbol.number_format($user_non_wdr_bal,$dec);
     35            $user_balance_total_formatted = $symbol.number_format($user_balance_total,$dec);
     36           
     37        }
     38         
    1739         $website_url = parse_url(get_bloginfo('url'));
    1840         $domain_name = trim($website_url['host'] ? $website_url['host'] : array_shift(explode('/', $website_url['path'], 2)));
     41         
     42         $blogurl = get_bloginfo('url');
     43         
     44         $blogname = get_bloginfo('name');
     45         $blogname_uppercase = strtoupper($blogname);
    1946         
    2047         $user_info = get_user_by('id', $user_id);
    2148         $user_email = $user_info->user_email;
    2249         
     50         $username = $user_info->user_login;
     51         $username_uppercase = strtoupper($username);
     52         
     53         $tnx_type_uppercase = strtoupper($tnx_type);
     54         
     55         $date_time = get_the_date('D, M j, Y', $txn_id).'<br>'.get_the_date('g:i A', $txn_id);
     56         
    2357            $to = $user_email;
    24             $subject  = "CREDIT of $amount_to_add on ".get_bloginfo('name')." - TXN #$txn_add_bal_id";
    25             $body = 'A new transaction has occured on your account';
     58           
     59            $subject  = "$tnx_type_uppercase of $amount_formatted ON $blogname_uppercase - TXN #$txn_add_bal_id";
     60           
     61            $body ="<style>
     62                    table,td {
     63                      border: 1px solid white;
     64                      border-collapse: collapse;
     65                     
     66                     
     67                    }
     68                   
     69                </style>
     70                <div style='background-color:#fff'>
     71               
     72                <table style='width:100%'>
     73                  <tr>
     74                    <th colspan='2' style='background: #ccc;padding: 15px;'>
     75                       $blogname_uppercase : A NEW TRANSACTION HAS OCCURED ON YOUR ACCOUNT ~ @{$username}
     76                    </th>
     77                  </tr>
     78               
     79                  <tr>
     80                    <td style='background-color:#ccc; padding: 20px; text-align: left;'><strong>TRANSACTION TYPE</strong></td>
     81                    <td style='background-color:#eee; padding: 20px; text-align: left;'> $tnx_type_uppercase </td>
     82                  </tr>
     83                 
     84                  <tr>
     85                    <td style='background-color:#ddd; padding: 20px; text-align: left;'><strong>TRANSACTION AMOUNT</strong></td>
     86                    <td style='background-color:#eee; padding: 20px; text-align: left;'> $amount_formatted </td>
     87                  </tr>
     88                 
     89                  <tr>
     90                    <td style='background-color:#ccc; padding: 20px; text-align: left;'><strong>TRANSACTION NOTE</strong></td>
     91                    <td style='background-color:#eee; padding: 20px; text-align: left;'> $note </td>
     92                  </tr>
     93                 
     94                  <tr>
     95                    <td style='background-color:#ddd; padding: 20px; text-align: left;'><strong>UNCLEARED BALANCE</strong></td>
     96                    <td style='background-color:#eee; padding: 20px; text-align: left;'> $user_non_wdr_bal_formatted </td>
     97                  </tr>
     98                 
     99                  <tr>
     100                    <td style='background-color:#ccc; padding: 20px; text-align: left;'><strong>CLEARED/ AVAILABLE BALANCE</strong></td>
     101                    <td style='background-color:#eee; padding: 20px; text-align: left;'> $user_wdr_bal_formatted </td>
     102                  </tr>
     103                 
     104                  <tr>
     105                    <td style='background-color:#ddd; padding: 20px; text-align: left;'><strong>TOTAL BALANCE</strong></td>
     106                    <td style='background-color:#eee; padding: 20px; text-align: left;'> $user_balance_total_formatted </td>
     107                  </tr>
     108                 
     109                  <tr>
     110                    <td style='background-color:#ccc; padding: 20px; text-align: left;'><strong>TRANSACTION DATE / TIME</strong></td>
     111                    <td style='background-color:#eee; padding: 20px; text-align: left;'> $date_time </td>
     112                  </tr>
     113                 
     114                </table>
     115                 <p style='background:#2d2f33; color:white; padding:25px; text-align:center;'>
     116                    This email was sent from <a href='$blogurl' style='color: #d28787;'> $blogname_uppercase </a>
     117                 </p>
     118                <div/>";
     119           
    26120            $headers  = "MIME-Version: 1.0" . "\r\n";
    27121            $headers .= "Content-type: text/html; charset=".get_bloginfo('charset')."" . "\r\n";
    28             $headers .= "From: Transaction Notifier <noreply@".$domain_name.">" . "\r\n";
     122            $headers .= "From: Transaction Notifier ~ $blogname <noreply@".$domain_name.">" . "\r\n";
    29123 
    30124             
  • rimplenet/trunk/includes/class-wallets.php

    r2463673 r2463950  
    128128       
    129129       
    130         $user_wdr_bal = $this->get_withdrawable_wallet_bal($user_id, $wallet_id);
    131         $user_non_wdr_bal = $this->get_nonwithdrawable_wallet_bal($user_id, $wallet_id);
    132        
    133         $walllets = $this->getWallets();
     130      $user_wdr_bal = $this->get_withdrawable_wallet_bal($user_id, $wallet_id);
     131      $user_non_wdr_bal = $this->get_nonwithdrawable_wallet_bal($user_id, $wallet_id);
     132     
     133      $walllets = $this->getWallets();
    134134        $dec = $walllets[$wallet_id]['decimal'];
    135135        $min_wdr_amount = $walllets[$wallet_id]['min_wdr_amount'];
     
    139139         
    140140        $balance = $symbol.number_format($balance,$dec);
    141        
     141     
    142142        if (empty($amount_to_withdraw) OR empty($wallet_id) ) {
    143             $wdr_info = 'One or more compulsory field is empty';
    144           }
    145         elseif ($amount_to_withdraw>$user_wdr_bal) {
    146             $wdr_info = 'Amount to withdraw - <strong>['.$symbol.number_format($amount_to_withdraw,$dec).']</strong> is larger than the amount in your mature wallet, input amount not more than the balance in your <strong>( '.$name.' mature wallet - ['.$symbol.number_format($user_wdr_bal,$dec).'] ),</strong> the balance in your <strong>( '.$name.' immature wallet  - ['. $symbol.number_format($user_non_wdr_bal,$dec).'] )</strong>  cannot be withdrawn until maturity';
    147           }
    148    
    149         elseif ($amount_to_withdraw<$min_wdr_amount) {
    150             $wdr_info = 'Requested amount ['.$amount_to_withdraw.'] is below minimum withdrawal amount, input amount not less than '.$min_wdr_amount;
    151         }   
    152         elseif ($amount_to_withdraw>$max_wdr_amount) {
    153             $wdr_info = 'Requested amount ['.$amount_to_withdraw.'] is above maximum withdrawal amount, input amount not more than '.$max_wdr_amount;
    154         }
    155         else{
    156            
    157                  
     143        $wdr_info = 'One or more compulsory field is empty';
     144        }
     145      elseif ($amount_to_withdraw>$user_wdr_bal) {
     146        $wdr_info = 'Amount to withdraw - <strong>['.$symbol.number_format($amount_to_withdraw,$dec).']</strong> is larger than the amount in your mature wallet, input amount not more than the balance in your <strong>( '.$name.' mature wallet - ['.$symbol.number_format($user_wdr_bal,$dec).'] ),</strong> the balance in your <strong>( '.$name.' immature wallet  - ['. $symbol.number_format($user_non_wdr_bal,$dec).'] )</strong>  cannot be withdrawn until maturity';
     147        }
     148   
     149      elseif ($amount_to_withdraw<$min_wdr_amount) {
     150        $wdr_info = 'Requested amount ['.$amount_to_withdraw.'] is below minimum withdrawal amount, input amount not less than '.$min_wdr_amount;
     151      }
     152      elseif ($amount_to_withdraw>$max_wdr_amount) {
     153        $wdr_info = 'Requested amount ['.$amount_to_withdraw.'] is above maximum withdrawal amount, input amount not more than '.$max_wdr_amount;
     154      }
     155      else{
     156       
     157           
    158158       
    159159         $amount_to_withdraw = $amount_to_withdraw * -1;
     
    180180             
    181181          }
    182         }
     182      }
    183183     wp_reset_postdata();
    184184    return $wdr_info;
     
    189189   
    190190        $current_user = get_user_by('ID', $user_id);
    191         $current_user_id  = $current_user ->ID;
    192        
     191      $current_user_id  = $current_user ->ID;
     192     
    193193        $user_transfer_to = get_user_by('login', $transfer_to_user);
    194         $transfer_to_user_id  = $user_transfer_to->ID;
    195        
    196         $min_transfer_amt = 0;
    197         $user_transfer_bal = $this->get_withdrawable_wallet_bal($user_id, $wallet_id);
    198         $user_non_transfer_bal = $this->get_nonwithdrawable_wallet_bal($user_id, $wallet_id);
    199        
    200         $walllets = $this->getWallets();
     194      $transfer_to_user_id  = $user_transfer_to->ID;
     195     
     196    $min_transfer_amt = 0;
     197      $user_transfer_bal = $this->get_withdrawable_wallet_bal($user_id, $wallet_id);
     198      $user_non_transfer_bal = $this->get_nonwithdrawable_wallet_bal($user_id, $wallet_id);
     199     
     200      $walllets = $this->getWallets();
    201201        $dec = $walllets[$wallet_id]['decimal'];
    202202        $symbol = $walllets[$wallet_id]['symbol'];
    203203        $name = $walllets[$wallet_id]['name'];
    204204        $balance = $symbol.number_format($balance,$dec);
    205        
    206        
     205     
     206     
    207207        if (empty($user_id) OR empty($amount_to_transfer) OR empty($wallet_id)  OR empty($transfer_to_user) ) {
    208             $transfer_info = 'One or more compulsory field is empty';
    209           }
    210         elseif ($amount_to_transfer>$user_transfer_bal) {
    211             $transfer_info = 'Amount to transfer - <strong>['.$symbol.number_format($amount_to_transfer,$dec).']</strong> is larger than the amount in your mature wallet, input amount not more than the balance in your <strong>( '.$name.' mature wallet - ['.$symbol.number_format($user_transfer_bal,$dec).'] ),</strong> the balance in your <strong>( '.$name.' immature wallet  - ['. $symbol.number_format($user_non_transfer_bal,$dec).'] )</strong>  cannot be transferred until maturity';
    212         }
    213         elseif ($amount_to_transfer<$min_transfer_amt) {
    214             $transfer_info = 'Requested amount ['.$amount_to_transfer.'] is below minimum transfer amount, input amount not less than '.$min_transfer_amt;
    215         }
    216         elseif (!username_exists($user_transfer_to->user_login)) {
    217             $transfer_info = 'User with the username <b>['.$transfer_to_user.']</b> does not exist, please crosscheck the username';
    218         }
    219         else{ // all is good, make transfer
    220            
    221           //transfer funds to user
    222          
     208        $transfer_info = 'One or more compulsory field is empty';
     209        }
     210      elseif ($amount_to_transfer>$user_transfer_bal) {
     211        $transfer_info = 'Amount to transfer - <strong>['.$symbol.number_format($amount_to_transfer,$dec).']</strong> is larger than the amount in your mature wallet, input amount not more than the balance in your <strong>( '.$name.' mature wallet - ['.$symbol.number_format($user_transfer_bal,$dec).'] ),</strong> the balance in your <strong>( '.$name.' immature wallet  - ['. $symbol.number_format($user_non_transfer_bal,$dec).'] )</strong>  cannot be transferred until maturity';
     212      }
     213      elseif ($amount_to_transfer<$min_transfer_amt) {
     214        $transfer_info = 'Requested amount ['.$amount_to_transfer.'] is below minimum transfer amount, input amount not less than '.$min_transfer_amt;
     215      }
     216      elseif (!username_exists($user_transfer_to->user_login)) {
     217      $transfer_info = 'User with the username <b>['.$transfer_to_user.']</b> does not exist, please crosscheck the username';
     218    }
     219      else{ // all is good, make transfer
     220       
     221        //transfer funds to user
     222       
    223223          $amount_to_transfer_to_user = apply_filters('rimplenet_amount_to_transfer', $amount_to_transfer, $wallet_id, $transfer_to_user_id);
    224224          $txn_transfer_id1 = $this->add_user_mature_funds_to_wallet($transfer_to_user_id,$amount_to_transfer_to_user, $wallet_id,$note);
     
    326326    update_post_meta($txn_add_bal_id, 'funds_type', $key);
    327327
    328     do_action("after_add_user_immature_funds_to_wallet",$txn_add_bal_id,$user_id,$amount_to_add,$wallet_id,$note,$tags);
     328    do_action("after_add_user_immature_funds_to_wallet",$txn_add_bal_id,$user_id,$amount_to_add,$wallet_id,$note,$tags,$tnx_type);
    329329   
    330330  return $txn_add_bal_id;
  • rimplenet/trunk/rimplenet.php

    r2463683 r2463950  
    1717 * Plugin URI:        https://rimplenet.com
    1818 * Description:       Rimplenet E-Banking | E-Wallets  | Investments Plugin | MLM | Matrix Tree | Referral Manager | FinTech
    19  * Version:           1.1.2
     19 * Version:           1.1.3
    2020 * Author:            Nellalink
    2121 * Author URI:        https://rimplenet.com
Note: See TracChangeset for help on using the changeset viewer.