<?php
/**
 * YAWIK
 *
 * @filesource
 * @license MIT
 * @copyright  2013 - 2015 Cross Solution <http://cross-solution.de>
 */

  /*
   * Available Variables:
   *
   * string $inviter          Name of inviter or his/her email address
   * string $organization     Name of the organization to which the invitation is made
   * string $token            Confirmation token
   * string $user             User who gets invited
   * boolean $hasAssociation  Wether or not the user is already assigned to an organization.
   *
   * If $hasAssociation is TRUE, the following variables are available:
   *
   * boolean $isOwner         Wether or not the user is the owner of his/her associated organization
   * string  $currentOrganization The name of the current organization.
   *
   */
?>
<div class="yk-mail">
<?= $this->partial('mail/header') ?>
<p>
    <?php if ($this->user): echo sprintf($this->translate('Hello %s'), $this->user);
         else: echo $this->translate('Hello');
         endif;?>,
</p>

<p>
    <?= sprintf($this->translate('%s invited you to join the team of %s'), $this->inviter, $this->organization) ?>
</p>

<p>
    <?= $this->translate('You can accept this invitation by visiting the following link') ?>:
</p>
<?= $this->link($this->serverUrl($this->url)) ?>

<?php if ($this->hasAssociation): ?>
<p>
    <?php if ($this->isOwner):
        echo sprintf(
           $this->translate('<strong>Please note: </strong> You are currently the owner of <b>%s</b>. Accepting this invitation will delete your organization.'),
           $this->currentOrganization
        );

        else:
            echo sprintf(
                    $this->translate('<strong>Please note: </strong> You are currently assigned as an employee to <b>%s</b>. Accepting this invitation will remove this association.'),
                    $this->currentOrganization
                 );
        endif; ?>
</p>
<?php endif ?>

<p>
    <?= $this->translate('If you do not want to accept this invitation you can ignore this mail and the request is canceled automatically after a week.'); ?>
</p>

<?= $this->partial('mail/footer') ?>
</div>
