本文整理汇总了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];
}
示例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];
}
示例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;
}
}