当前位置: 首页>>代码示例>>PHP>>正文


PHP Invitation::getLink方法代码示例

本文整理汇总了PHP中app\models\Invitation::getLink方法的典型用法代码示例。如果您正苦于以下问题:PHP Invitation::getLink方法的具体用法?PHP Invitation::getLink怎么用?PHP Invitation::getLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Invitation的用法示例。


在下文中一共展示了Invitation::getLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: transform

 public function transform(Invitation $invitation)
 {
     return ['id' => (int) $invitation->public_id, 'key' => $invitation->getName(), 'status' => $invitation->getStatus(), 'link' => $invitation->getLink(), 'sent_date' => $invitation->sent_date, 'viewed_date' => $invitation->sent_date];
 }
开发者ID:hannenijhuis,项目名称:invoiceninja,代码行数:4,代码来源:InvitationTransformer.php

示例2: transform

 public function transform(Invitation $invitation)
 {
     $invitation->setRelation('account', $this->account);
     return ['id' => (int) $invitation->public_id, 'key' => $invitation->getName(), 'status' => $invitation->getStatus(), 'link' => $invitation->getLink(), 'sent_date' => $invitation->sent_date, 'viewed_date' => $invitation->sent_date];
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:5,代码来源:InvitationTransformer.php

示例3: sendInvitation

 /**
  * @param Invitation $invitation
  * @param Invoice $invoice
  * @param $body
  * @param $subject
  * @param $pdfString
  * @param $documentStrings
  * @return bool|string
  * @throws \Laracasts\Presenter\Exceptions\PresenterException
  */
 private function sendInvitation(Invitation $invitation, Invoice $invoice, $body, $subject, $pdfString, $documentStrings)
 {
     $client = $invoice->client;
     $account = $invoice->account;
     if (Auth::check()) {
         $user = Auth::user();
     } else {
         $user = $invitation->user;
         if ($invitation->user->trashed()) {
             $user = $account->users()->orderBy('id')->first();
         }
     }
     if (!$user->email || !$user->registered) {
         return trans('texts.email_error_user_unregistered');
     } elseif (!$user->confirmed) {
         return trans('texts.email_error_user_unconfirmed');
     } elseif (!$invitation->contact->email) {
         return trans('texts.email_error_invalid_contact_email');
     } elseif ($invitation->contact->trashed()) {
         return trans('texts.email_error_inactive_contact');
     }
     $variables = ['account' => $account, 'client' => $client, 'invitation' => $invitation, 'amount' => $invoice->getRequestedAmount()];
     // Let the client know they'll be billed later
     if ($client->autoBillLater()) {
         $variables['autobill'] = $invoice->present()->autoBillEmailMessage();
     }
     if (empty($invitation->contact->password) && $account->hasFeature(FEATURE_CLIENT_PORTAL_PASSWORD) && $account->enable_portal_password && $account->send_portal_password) {
         // The contact needs a password
         $variables['password'] = $password = $this->generatePassword();
         $invitation->contact->password = bcrypt($password);
         $invitation->contact->save();
     }
     $data = ['body' => $this->templateService->processVariables($body, $variables), 'link' => $invitation->getLink(), 'entityType' => $invoice->getEntityType(), 'invoiceId' => $invoice->id, 'invitation' => $invitation, 'account' => $account, 'client' => $client, 'invoice' => $invoice, 'documents' => $documentStrings];
     if ($account->attachPDF()) {
         $data['pdfString'] = $pdfString;
         $data['pdfFileName'] = $invoice->getFileName();
     }
     $subject = $this->templateService->processVariables($subject, $variables);
     $fromEmail = $user->email;
     $view = $account->getTemplateView(ENTITY_INVOICE);
     $response = $this->sendTo($invitation->contact->email, $fromEmail, $account->getDisplayName(), $subject, $view, $data);
     if ($response === true) {
         return true;
     } else {
         return $response;
     }
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:57,代码来源:ContactMailer.php


注:本文中的app\models\Invitation::getLink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。