public function updateSubAccount(User $user)
 {
     $userCurrentPlan = $user->getProfile()->getCurrentPlan();
     $plan = $userCurrentPlan->getPlan();
     $subaccount_id = $user->getUsername();
     $notes = "{$plan->getName()} plan user, signed up on {$userCurrentPlan->getDateStart()->forma('m/d/Y h:i')}";
     $custom_quota = $plan->getTotalEmails();
     $this->mandrillApi->update->add($subaccount_id, null, $notes, $custom_quota);
 }
예제 #2
0
 public function __construct(User $user, Property $property, Template $template)
 {
     $this->user = $user;
     $this->creation_date = new \DateTime();
     $this->modification_date = $this->creation_date;
     $this->property = $property;
     $this->template = $template;
     $this->total_sent = 0;
     //Binding Flyer with Property
     $this->email = $user->getProfile()->getEmail();
     $this->sender_name = $user->getProfile()->getFullName();
     $this->email_reply = $user->getProfile()->getEmail();
     $this->address = $property->getAddress();
     $this->map_active = true;
     $this->lat = $property->getLat();
     $this->lng = $property->getLng();
     $this->map_zoom = $property->getMapZoom();
     $this->map_center_lat = $property->getMapCenterLat();
     $this->map_center_lng = $property->getMapCenterLng();
 }
 public function getInvoices(User $user)
 {
     $customer_id = $user->getProfile() ? $user->getProfile()->getCustomerId() : null;
     if ($customer_id) {
         $invoices = \Stripe_Invoice::all(array("customer" => $customer_id));
         if ($invoices && $invoices->data) {
             return $invoices->data;
         }
     }
     return null;
 }