oc-content/plugins/favorite_items/index.php
// SEND EMAIL WHEN LISTING IS REMOVED
SEND EMAIL WHEN LISTING IS REMOVED
SEND EMAIL WHEN LISTING IS REMOVED
function fi_item_remove( $item_id ) {
  $item_id = $item_id;
  $item = Item::newInstance()->findByPrimaryKey( $item_id );
  $item_price = isset($item['i_price']) ? $item['i_price'] : '';
  $formatted_price = fi_price_format($item_price, isset($item['fk_c_currency_code']) ? $item['fk_c_currency_code'] : '');
  $user_list = ModelFI::newInstance()->getUserListByItemId( $item_id );     
  foreach($user_list as $u) {
    if(isset($u['user_email']) && isset($u['user_name'])) {
      fi_email_item_remove($u['user_email'], $u['user_name'], $item_id, $formatted_price);
    }
  }
}
function fi_item_remove ( $ item_id ) { $ item_id = $ item_id ; $ item = Item :: newInstance ( ) -> findByPrimaryKey ( $ item_id ) ; $ item_price = isset ( $ item [ 'i_price' ] ) ? $ item [ 'i_price' ] : '' ; $ formatted_price = fi_price_format ( $ item_price , isset ( $ item [ 'fk_c_currency_code' ] ) ? $ item [ 'fk_c_currency_code' ] : '' ) ; $ user_list = ModelFI :: newInstance ( ) -> getUserListByItemId ( $ item_id ) ; foreach ( $ user_list as $ u ) { if ( isset ( $ u [ 'user_email' ] ) && isset ( $ u [ 'user_name' ] ) ) { fi_email_item_remove ( $ u [ 'user_email' ] , $ u [ 'user_name' ] , $ item_id , $ formatted_price ) ; } } }
SEND EMAIL WHEN LISTING IS REMOVED
SEND EMAIL WHEN LISTING IS REMOVED
// get all user emails that has this listing in favorite list // SEND EMAIL THAT PRICE HAS CHANGED