Example #1
0
 function process()
 {
     $account = BeanFactory::getBean('xeBayAccounts', $this->bean->xebayaccount_id);
     $subject = $_REQUEST['subject'];
     $message = $_REQUEST['message'];
     $questionType = $_REQUEST['question_type'];
     $itemID = $_REQUEST['item_id'];
     if (empty($message) || empty($subject) || empty($itemID)) {
         header("Location: index.php?module=xeBayOrders&action=DetailView&record={$this->bean->id}");
     }
     $x = new AddMemberMessageAAQToPartner();
     $res = $x->addMemberMessage(array('AccountID' => $account->id, 'AuthToken' => $account->ebay_auth_token, 'ItemID' => $itemID, 'Body' => $message, 'QuestionType' => $questionType, 'RecipientID' => $this->bean->buyer_user_id, 'Subject' => $subject));
     if ($res == true) {
         header("Location: index.php?module=xeBayOrders&action=DetailView&record={$this->bean->id}");
     }
     parent::process();
 }
Example #2
0
    function send_comfort_message($bean, $duration, $passdays)
    {
        $xebayaccount_id = $bean->xebayaccount_id;
        $bean->load_relationship('xebaytransactions');
        $transactions = $bean->xebaytransactions->getBeans();
        foreach ($transactions as &$transaction) {
            $buyer_user_id = $bean->buyer_user_id;
            $subject = $transaction->name;
            $message = "";
            $questionType = 'Shipping';
            $itemID = $transaction->item_item_id;
            $message = '';
            switch ($duration) {
                case '25th Day':
                    $message = <<<EOF
Hi friend.
  Your item has been shipped on {$bean->shipped_time} by air mail.
  If you haven't received your item and this situation lasts to the 35th day, please do contact us.
  A FULL REFUND will be issued to you with NO EXCUSE. 
  We do not want to give you a bad buying experience even when the shipping is out of our control.
  But if you receive it, we sincerely hope you can leave us a positive comment if you like it and
  appreciate our customer services.
  Thanks once more for your purchase.

  Yours Sincerely
EOF;
                    break;
                case '15th Day':
                    $message = <<<EOF
Hi friend.
  Your item has been shipped on {$bean->shipped_time} by air mail.
  {$passdays} days have passed since your item was shipped,
  When you receive it, we sincerely hope that you will like it and appreciate our customer services.
  If there is anything you feel unsatisfied with, please do tell us. 
  This will help us know what we should do to help you as well as how we should improve.
  If you are satisfied, we sincerely hope that you can leave us a positive comment, 
  which is of vital importance to the growth of our small company.
  PLEASE DO NOT leaves us negative feedback. If you are not satisfied in any regard, please tell us.
  Thanks once more for your purchase.
  
  Yours Sincerely
EOF;
                    break;
                default:
                    $message = <<<EOF
Hi friend.
  Your item has been shipped on {$bean->shipped_time} by air mail, and it may take about 7~20 days to arrive,
  sometimes it may be delayed by unexpected reason like holiday, custom`s process, weather condition etc.
  It may be delayed up to 35 days to arrive. We will be very appreciated for your patient.
  If you have any question, feel free to contact us asap.
  Thanks for your purchase.
  
  Yours Sincerely
EOF;
                    break;
            }
            //echo "<pre>$message</pre>";
            $api = new AddMemberMessageAAQToPartner();
            $res = $api->addMemberMessage(array('AccountID' => $xebayaccount_id, 'AuthToken' => $this->accounts[$xebayaccount_id], 'ItemID' => $itemID, 'Body' => $message, 'QuestionType' => $questionType, 'RecipientID' => $buyer_user_id, 'Subject' => $subject));
            $bean->buyer_comfort_status_update($bean->id, $duration);
            break;
        }
    }