first commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @file classes/mailable/Repository.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class Repository
|
||||
*
|
||||
* @brief A repository to find and edit Mailables.
|
||||
*/
|
||||
|
||||
namespace APP\mail;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class Repository extends \PKP\mail\Repository
|
||||
{
|
||||
/**
|
||||
* Registers app-specific mailables
|
||||
*/
|
||||
public function map(): Collection
|
||||
{
|
||||
return parent::map()->merge(collect([
|
||||
mailables\IssuePublishedNotify::class,
|
||||
mailables\OpenAccessNotify::class,
|
||||
mailables\SubscriptionExpired::class,
|
||||
mailables\SubscriptionExpiredLast::class,
|
||||
mailables\SubscriptionExpiresSoon::class,
|
||||
mailables\SubscriptionNotify::class,
|
||||
mailables\SubscriptionPurchaseIndividual::class,
|
||||
mailables\SubscriptionPurchaseInstitutional::class,
|
||||
mailables\SubscriptionRenewIndividual::class,
|
||||
mailables\SubscriptionRenewInstitutional::class,
|
||||
mailables\PaymentRequest::class,
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/IssuePublishedNotify.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class IssuePublishedNotify
|
||||
*
|
||||
* @ingroup mail_mailables
|
||||
*
|
||||
* @brief Email is sent automatically to all registered users to notify about new published issue
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\issue\Issue;
|
||||
use APP\mail\variables\IssueEmailVariable;
|
||||
use PKP\context\Context;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Recipient;
|
||||
use PKP\mail\traits\Sender;
|
||||
use PKP\mail\traits\Unsubscribe;
|
||||
use PKP\security\Role;
|
||||
|
||||
class IssuePublishedNotify extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Recipient;
|
||||
use Sender;
|
||||
use Unsubscribe;
|
||||
|
||||
protected static ?string $name = 'mailable.issuePublishNotify.name';
|
||||
protected static ?string $description = 'mailable.issuePublishNotify.description';
|
||||
protected static ?string $emailTemplateKey = 'ISSUE_PUBLISH_NOTIFY';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [Role::ROLE_ID_SUB_EDITOR];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_READER];
|
||||
|
||||
protected Context $context;
|
||||
|
||||
public function __construct(Context $context, Issue $issue)
|
||||
{
|
||||
parent::__construct([$context, $issue]);
|
||||
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
protected static function templateVariablesMap(): array
|
||||
{
|
||||
$map = parent::templateVariablesMap();
|
||||
$map[Issue::class] = IssueEmailVariable::class;
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a footer with unsubscribe link
|
||||
*/
|
||||
protected function addFooter(string $locale): Mailable
|
||||
{
|
||||
$this->setupUnsubscribeFooter($locale, $this->context);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/OpenAccessNotify.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class OpenAccessNotify
|
||||
*
|
||||
* @brief Email sent to notify user about issue open access
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\issue\Issue;
|
||||
use APP\journal\Journal;
|
||||
use APP\mail\variables\IssueEmailVariable;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Recipient;
|
||||
use PKP\mail\traits\Unsubscribe;
|
||||
use PKP\security\Role;
|
||||
|
||||
class OpenAccessNotify extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Recipient;
|
||||
use Unsubscribe;
|
||||
|
||||
protected static ?string $name = 'mailable.openAccessNotify.name';
|
||||
protected static ?string $description = 'mailable.openAccessNotify.description';
|
||||
protected static ?string $emailTemplateKey = 'OPEN_ACCESS_NOTIFY';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [self::FROM_SYSTEM];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_READER];
|
||||
|
||||
protected Journal $context;
|
||||
|
||||
public function __construct(Journal $context, Issue $issue)
|
||||
{
|
||||
parent::__construct([$context, $issue]);
|
||||
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
protected static function templateVariablesMap(): array
|
||||
{
|
||||
$map = parent::templateVariablesMap();
|
||||
$map[Issue::class] = IssueEmailVariable::class;
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a footer with unsubscribe link
|
||||
*/
|
||||
protected function addFooter(string $locale): Mailable
|
||||
{
|
||||
$this->setupUnsubscribeFooter($locale, $this->context);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/PaymentRequest.php
|
||||
*
|
||||
* Copyright (c) 2014-2023 Simon Fraser University
|
||||
* Copyright (c) 2000-2023 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class PaymentRequest
|
||||
*
|
||||
* @ingroup mail_mailables
|
||||
*
|
||||
* @brief Email is sent automatically to notify authors of the submission about the required payment
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\core\Application;
|
||||
use APP\journal\Journal;
|
||||
use APP\mail\variables\ContextEmailVariable;
|
||||
use APP\submission\Submission;
|
||||
use PKP\core\PKPApplication;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Recipient;
|
||||
use PKP\mail\variables\ContextEmailVariable as PKPContextEmailVariable;
|
||||
use PKP\payment\QueuedPayment;
|
||||
use PKP\security\Role;
|
||||
|
||||
class PaymentRequest extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Recipient;
|
||||
|
||||
protected static ?string $name = 'mailable.paymentRequest.name';
|
||||
protected static ?string $description = 'mailable.paymentRequest.description';
|
||||
protected static ?string $emailTemplateKey = 'PAYMENT_REQUEST_NOTIFICATION';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [self::FROM_SYSTEM];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_AUTHOR];
|
||||
|
||||
protected static string $queuedPaymentUrl = 'queuedPaymentUrl';
|
||||
protected static string $submissionGuidelinesUrl = 'submissionGuidelinesUrl';
|
||||
|
||||
public function __construct(Journal $context, Submission $submission, QueuedPayment $queuedPayment)
|
||||
{
|
||||
parent::__construct(func_get_args());
|
||||
$this->setupPaymentUrlVariable($context, $queuedPayment);
|
||||
}
|
||||
|
||||
protected function setupPaymentUrlVariable(Journal $context, QueuedPayment $queuedPayment)
|
||||
{
|
||||
$request = Application::get()->getRequest();
|
||||
$dispatcher = $request->getDispatcher();
|
||||
$this->addData([
|
||||
static::$queuedPaymentUrl => $dispatcher->url(
|
||||
$request,
|
||||
PKPApplication::ROUTE_PAGE,
|
||||
$context->getPath(),
|
||||
'payment',
|
||||
'pay',
|
||||
[$queuedPayment->getId()]
|
||||
),
|
||||
static::$submissionGuidelinesUrl => $dispatcher->url(
|
||||
$request,
|
||||
Application::ROUTE_PAGE,
|
||||
$context->getPath(),
|
||||
'about',
|
||||
'submissions'
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getDataDescriptions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getDataDescriptions(),
|
||||
[
|
||||
static::$queuedPaymentUrl => __('emailTemplate.variable.queuedPaymentUrl'),
|
||||
static::$submissionGuidelinesUrl => __('emailTemplate.variable.submissionGuidelinesUrl'),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
protected function addFooter(string $locale): self
|
||||
{
|
||||
$this->footer = $this->renameContextVariables(
|
||||
__('emails.paymentRequestNotification.footer', [], $locale)
|
||||
);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace email template variables in the locale string, so they correspond to the application,
|
||||
* e.g., contextName => journalName/pressName/serverName
|
||||
*/
|
||||
protected function renameContextVariables(string $footer): string
|
||||
{
|
||||
$map = [
|
||||
'{$' . PKPContextEmailVariable::CONTEXT_NAME . '}' => '{$' . ContextEmailVariable::CONTEXT_NAME . '}',
|
||||
'{$' . PKPContextEmailVariable::CONTEXT_URL . '}' => '{$' . ContextEmailVariable::CONTEXT_URL . '}',
|
||||
];
|
||||
|
||||
return str_replace(array_keys($map), array_values($map), $footer);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/SubscriptionExpired.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionExpired
|
||||
*
|
||||
* @brief Email sent automatically to notify a subscriber that their subscription has expired
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\journal\Journal;
|
||||
use APP\mail\traits\SubscriptionTypeVariables;
|
||||
use APP\mail\variables\SubscriptionEmailVariable;
|
||||
use APP\subscription\Subscription;
|
||||
use APP\subscription\SubscriptionType;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Recipient;
|
||||
use PKP\security\Role;
|
||||
|
||||
class SubscriptionExpired extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Recipient;
|
||||
use SubscriptionTypeVariables;
|
||||
|
||||
protected static ?string $name = 'mailable.subscriptionExpired.name';
|
||||
protected static ?string $description = 'mailable.subscriptionExpired.description';
|
||||
protected static ?string $emailTemplateKey = 'SUBSCRIPTION_AFTER_EXPIRY';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [self::FROM_SYSTEM];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_READER];
|
||||
|
||||
public function __construct(Journal $context, Subscription $subscription, SubscriptionType $subscriptionType)
|
||||
{
|
||||
parent::__construct([$context, $subscription]);
|
||||
$this->setupSubscriptionTypeVariables($subscriptionType, $context);
|
||||
}
|
||||
|
||||
protected static function templateVariablesMap(): array
|
||||
{
|
||||
$map = parent::templateVariablesMap();
|
||||
$map[Subscription::class] = SubscriptionEmailVariable::class;
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description for subscription type related variables
|
||||
*/
|
||||
public static function getDataDescriptions(): array
|
||||
{
|
||||
$variables = parent::getDataDescriptions();
|
||||
return static::addSubscriptionTypeVariablesDescription($variables);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/SubscriptionExpired.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionExpired
|
||||
*
|
||||
* @brief Email sent automatically to notify a subscriber the second time that their subscription has expired
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\journal\Journal;
|
||||
use APP\mail\traits\SubscriptionTypeVariables;
|
||||
use APP\mail\variables\SubscriptionEmailVariable;
|
||||
use APP\subscription\Subscription;
|
||||
use APP\subscription\SubscriptionType;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Recipient;
|
||||
use PKP\security\Role;
|
||||
|
||||
class SubscriptionExpiredLast extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Recipient;
|
||||
use SubscriptionTypeVariables;
|
||||
|
||||
protected static ?string $name = 'mailable.subscriptionExpiredLast.name';
|
||||
protected static ?string $description = 'mailable.subscriptionExpiredLast.description';
|
||||
protected static ?string $emailTemplateKey = 'SUBSCRIPTION_AFTER_EXPIRY_LAST';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [self::FROM_SYSTEM];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_READER];
|
||||
|
||||
public function __construct(Journal $context, Subscription $subscription, SubscriptionType $subscriptionType)
|
||||
{
|
||||
parent::__construct([$context, $subscription]);
|
||||
$this->setupSubscriptionTypeVariables($subscriptionType, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup subscription related variables
|
||||
*/
|
||||
protected static function templateVariablesMap(): array
|
||||
{
|
||||
$map = parent::templateVariablesMap();
|
||||
$map[Subscription::class] = SubscriptionEmailVariable::class;
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description for subscription type related variables
|
||||
*/
|
||||
public static function getDataDescriptions(): array
|
||||
{
|
||||
$variables = parent::getDataDescriptions();
|
||||
return static::addSubscriptionTypeVariablesDescription($variables);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/SubscriptionExpiresSoon.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionExpiresSoon
|
||||
*
|
||||
* @brief Email sent automatically to notify a subscriber that their subscription expires soon
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\journal\Journal;
|
||||
use APP\mail\traits\SubscriptionTypeVariables;
|
||||
use APP\mail\variables\SubscriptionEmailVariable;
|
||||
use APP\subscription\Subscription;
|
||||
use APP\subscription\SubscriptionType;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Recipient;
|
||||
use PKP\security\Role;
|
||||
|
||||
class SubscriptionExpiresSoon extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Recipient;
|
||||
use SubscriptionTypeVariables;
|
||||
|
||||
protected static ?string $name = 'mailable.subscriptionExpiresSoon.name';
|
||||
protected static ?string $description = 'mailable.subscriptionExpiresSoon.description';
|
||||
protected static ?string $emailTemplateKey = 'SUBSCRIPTION_BEFORE_EXPIRY';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [self::FROM_SYSTEM];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_READER];
|
||||
|
||||
public function __construct(Journal $context, Subscription $subscription, SubscriptionType $subscriptionType)
|
||||
{
|
||||
parent::__construct([$context, $subscription]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup subscription related variables
|
||||
*/
|
||||
protected static function templateVariablesMap(): array
|
||||
{
|
||||
$map = parent::templateVariablesMap();
|
||||
$map[Subscription::class] = SubscriptionEmailVariable::class;
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description for subscription type related variables
|
||||
*/
|
||||
public static function getDataDescriptions(): array
|
||||
{
|
||||
$variables = parent::getDataDescriptions();
|
||||
return static::addSubscriptionTypeVariablesDescription($variables);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/SubscriptionNotify.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionNotify
|
||||
*
|
||||
* @brief Email sent to notify user about new subscription
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\journal\Journal;
|
||||
use APP\mail\traits\SubscriptionTypeVariables;
|
||||
use APP\mail\variables\SubscriptionEmailVariable;
|
||||
use APP\subscription\Subscription;
|
||||
use APP\subscription\SubscriptionType;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Recipient;
|
||||
use PKP\security\Role;
|
||||
|
||||
class SubscriptionNotify extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Recipient;
|
||||
use SubscriptionTypeVariables;
|
||||
|
||||
protected static ?string $name = 'mailable.subscriptionNotify.name';
|
||||
protected static ?string $description = 'mailable.subscriptionNotify.description';
|
||||
protected static ?string $emailTemplateKey = 'SUBSCRIPTION_NOTIFY';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [Role::ROLE_ID_SUBSCRIPTION_MANAGER];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_READER];
|
||||
|
||||
public function __construct(Journal $context, Subscription $subscription, SubscriptionType $subscriptionType)
|
||||
{
|
||||
parent::__construct([$context, $subscription]);
|
||||
$this->setupSubscriptionTypeVariables($subscriptionType, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup subscription related variables
|
||||
*/
|
||||
protected static function templateVariablesMap(): array
|
||||
{
|
||||
$map = parent::templateVariablesMap();
|
||||
$map[Subscription::class] = SubscriptionEmailVariable::class;
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description for subscription type related variables
|
||||
*/
|
||||
public static function getDataDescriptions(): array
|
||||
{
|
||||
$variables = parent::getDataDescriptions();
|
||||
return static::addSubscriptionTypeVariablesDescription($variables);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/SubscriptionPurchaseIndividual.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionPurchaseIndividual
|
||||
*
|
||||
* @brief Email sent automatically to notify a subscription manager about new subscription
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\journal\Journal;
|
||||
use APP\mail\traits\SubscriptionTypeVariables;
|
||||
use APP\mail\variables\SubscriptionEmailVariable;
|
||||
use APP\subscription\IndividualSubscription;
|
||||
use APP\subscription\Subscription;
|
||||
use APP\subscription\SubscriptionType;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Sender;
|
||||
use PKP\security\Role;
|
||||
|
||||
class SubscriptionPurchaseIndividual extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Sender;
|
||||
use SubscriptionTypeVariables;
|
||||
|
||||
protected static ?string $name = 'mailable.subscriptionPurchaseIndividual.name';
|
||||
protected static ?string $description = 'mailable.subscriptionPurchaseIndividual.description';
|
||||
protected static ?string $emailTemplateKey = 'SUBSCRIPTION_PURCHASE_INDL';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [Role::ROLE_ID_READER];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_SUBSCRIPTION_MANAGER];
|
||||
|
||||
public function __construct(Journal $context, IndividualSubscription $subscription, SubscriptionType $subscriptionType)
|
||||
{
|
||||
parent::__construct([$context, $subscription]);
|
||||
$this->setupSubscriptionTypeVariables($subscriptionType, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup subscription related variables
|
||||
*/
|
||||
protected static function templateVariablesMap(): array
|
||||
{
|
||||
$map = parent::templateVariablesMap();
|
||||
$map[Subscription::class] = SubscriptionEmailVariable::class;
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description for subscription type related variables
|
||||
*/
|
||||
public static function getDataDescriptions(): array
|
||||
{
|
||||
$variables = parent::getDataDescriptions();
|
||||
return static::addSubscriptionTypeVariablesDescription($variables);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/SubscriptionPurchaseInstitutional.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionPurchaseInstitutional
|
||||
*
|
||||
* @brief Email sent automatically to notify a subscription manager about new subscription
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\journal\Journal;
|
||||
use APP\mail\traits\SubscriptionInstitutional;
|
||||
use APP\mail\traits\SubscriptionTypeVariables;
|
||||
use APP\mail\variables\SubscriptionEmailVariable;
|
||||
use APP\subscription\InstitutionalSubscription;
|
||||
use APP\subscription\Subscription;
|
||||
use APP\subscription\SubscriptionType;
|
||||
use PKP\institution\Institution;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Sender;
|
||||
use PKP\security\Role;
|
||||
|
||||
class SubscriptionPurchaseInstitutional extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Sender;
|
||||
use SubscriptionInstitutional;
|
||||
use SubscriptionTypeVariables;
|
||||
|
||||
protected static ?string $name = 'mailable.subscriptionPurchaseInstitutional.name';
|
||||
protected static ?string $description = 'mailable.subscriptionPurchaseInstitutional.description';
|
||||
protected static ?string $emailTemplateKey = 'SUBSCRIPTION_PURCHASE_INSTL';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [Role::ROLE_ID_READER];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_SUBSCRIPTION_MANAGER];
|
||||
|
||||
public function __construct(
|
||||
Journal $context,
|
||||
InstitutionalSubscription $subscription,
|
||||
SubscriptionType $subscriptionType,
|
||||
Institution $institution
|
||||
) {
|
||||
parent::__construct([$context, $subscription]);
|
||||
$this->setupInstitutionalVariables($subscription, $institution);
|
||||
$this->setupSubscriptionTypeVariables($subscriptionType, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup subscription related variables
|
||||
*/
|
||||
protected static function templateVariablesMap(): array
|
||||
{
|
||||
$map = parent::templateVariablesMap();
|
||||
$map[Subscription::class] = SubscriptionEmailVariable::class;
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description for institution related template variables
|
||||
*/
|
||||
public static function getDataDescriptions(): array
|
||||
{
|
||||
$variables = parent::getDataDescriptions();
|
||||
$variables = static::addInstitutionalVariablesDescription($variables);
|
||||
return static::addSubscriptionTypeVariablesDescription($variables);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/SubscriptionRenewIndividual.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionRenewIndividual
|
||||
*
|
||||
* @brief Email sent automatically to notify a subscription manager about subscription renewal
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\journal\Journal;
|
||||
use APP\mail\traits\SubscriptionTypeVariables;
|
||||
use APP\mail\variables\SubscriptionEmailVariable;
|
||||
use APP\subscription\IndividualSubscription;
|
||||
use APP\subscription\Subscription;
|
||||
use APP\subscription\SubscriptionType;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Sender;
|
||||
use PKP\security\Role;
|
||||
|
||||
class SubscriptionRenewIndividual extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Sender;
|
||||
use SubscriptionTypeVariables;
|
||||
|
||||
protected static ?string $name = 'mailable.subscriptionRenewIndividual.name';
|
||||
protected static ?string $description = 'mailable.subscriptionRenewIndividual.description';
|
||||
protected static ?string $emailTemplateKey = 'SUBSCRIPTION_RENEW_INDL';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [Role::ROLE_ID_READER];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_SUBSCRIPTION_MANAGER];
|
||||
|
||||
public function __construct(Journal $context, IndividualSubscription $subscription, SubscriptionType $subscriptionType)
|
||||
{
|
||||
parent::__construct([$context, $subscription]);
|
||||
$this->setupSubscriptionTypeVariables($subscriptionType, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup subscription related variables
|
||||
*/
|
||||
protected static function templateVariablesMap(): array
|
||||
{
|
||||
$map = parent::templateVariablesMap();
|
||||
$map[Subscription::class] = SubscriptionEmailVariable::class;
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description for subscription type related variables
|
||||
*/
|
||||
public static function getDataDescriptions(): array
|
||||
{
|
||||
$variables = parent::getDataDescriptions();
|
||||
return static::addSubscriptionTypeVariablesDescription($variables);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/mailables/SubscriptionRenewInstitutional.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionRenewInstitutional
|
||||
*
|
||||
* @brief Email sent automatically to notify a subscription manager about subscription renewal
|
||||
*/
|
||||
|
||||
namespace APP\mail\mailables;
|
||||
|
||||
use APP\journal\Journal;
|
||||
use APP\mail\traits\SubscriptionInstitutional;
|
||||
use APP\mail\traits\SubscriptionTypeVariables;
|
||||
use APP\mail\variables\SubscriptionEmailVariable;
|
||||
use APP\subscription\InstitutionalSubscription;
|
||||
use APP\subscription\Subscription;
|
||||
use APP\subscription\SubscriptionType;
|
||||
use PKP\institution\Institution;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\traits\Configurable;
|
||||
use PKP\mail\traits\Sender;
|
||||
use PKP\security\Role;
|
||||
|
||||
class SubscriptionRenewInstitutional extends Mailable
|
||||
{
|
||||
use Configurable;
|
||||
use Sender;
|
||||
use SubscriptionInstitutional;
|
||||
use SubscriptionTypeVariables;
|
||||
|
||||
protected static ?string $name = 'mailable.subscriptionRenewInstitutional.name';
|
||||
protected static ?string $description = 'mailable.subscriptionRenewInstitutional.description';
|
||||
protected static ?string $emailTemplateKey = 'SUBSCRIPTION_RENEW_INSTL';
|
||||
protected static array $groupIds = [self::GROUP_OTHER];
|
||||
protected static array $fromRoleIds = [Role::ROLE_ID_READER];
|
||||
protected static array $toRoleIds = [Role::ROLE_ID_SUBSCRIPTION_MANAGER];
|
||||
|
||||
public function __construct(
|
||||
Journal $context,
|
||||
InstitutionalSubscription $subscription,
|
||||
SubscriptionType $subscriptionType,
|
||||
Institution $institution,
|
||||
) {
|
||||
parent::__construct(func_get_args());
|
||||
$this->setupInstitutionalVariables($subscription, $institution);
|
||||
$this->setupSubscriptionTypeVariables($subscriptionType, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup subscription related variables
|
||||
*/
|
||||
protected static function templateVariablesMap(): array
|
||||
{
|
||||
$map = parent::templateVariablesMap();
|
||||
$map[Subscription::class] = SubscriptionEmailVariable::class;
|
||||
return $map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description for institution related template variables
|
||||
*/
|
||||
public static function getDataDescriptions(): array
|
||||
{
|
||||
$variables = parent::getDataDescriptions();
|
||||
$variables = static::addInstitutionalVariablesDescription($variables);
|
||||
return static::addSubscriptionTypeVariablesDescription($variables);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file mail/traits/SubscriptionInstitutional.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionInstitutional
|
||||
*
|
||||
* @ingroup mail_traits
|
||||
*
|
||||
* @brief Mailable trait to set institutional subscription variables
|
||||
*/
|
||||
|
||||
namespace APP\mail\traits;
|
||||
|
||||
use APP\subscription\InstitutionalSubscription;
|
||||
use PKP\institution\Institution;
|
||||
|
||||
trait SubscriptionInstitutional
|
||||
{
|
||||
abstract public function addData(array $variables);
|
||||
|
||||
protected static string $institutionName = 'institutionName';
|
||||
protected static string $institutionMailingAddress = 'institutionMailingAddress';
|
||||
protected static string $domain = 'domain';
|
||||
protected static string $ipRanges = 'ipRanges';
|
||||
|
||||
protected function setupInstitutionalVariables(InstitutionalSubscription $subscription, Institution $institution): void
|
||||
{
|
||||
$this->addData([
|
||||
static::$institutionName => $institution->getLocalizedName(),
|
||||
static::$institutionMailingAddress => $subscription->getInstitutionMailingAddress(),
|
||||
static::$domain => $subscription->getDomain(),
|
||||
static::$ipRanges => implode(' ', $institution->getIPRanges()),
|
||||
]);
|
||||
}
|
||||
|
||||
protected static function addInstitutionalVariablesDescription(array $variables): array
|
||||
{
|
||||
return array_merge(
|
||||
$variables,
|
||||
[
|
||||
static::$institutionName => __('emailTemplate.variable.subscription.institutionName'),
|
||||
static::$institutionMailingAddress => __('emailTemplate.variable.subscription.institutionMailingAddress'),
|
||||
static::$domain => __('emailTemplate.variable.subscription.domain'),
|
||||
static::$ipRanges => __('emailTemplate.variable.subscription.ipRanges'),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file mail/traits/SubscriptionTypeVariables.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionTypeVariables
|
||||
*
|
||||
* @ingroup mail_traits
|
||||
*
|
||||
* @brief Mailable trait to set variables related to subscription type
|
||||
*/
|
||||
|
||||
namespace APP\mail\traits;
|
||||
|
||||
use APP\core\Application;
|
||||
use APP\journal\Journal;
|
||||
use APP\subscription\SubscriptionType;
|
||||
|
||||
trait SubscriptionTypeVariables
|
||||
{
|
||||
protected static string $subscriptionUrl = 'subscriptionUrl';
|
||||
protected static string $subscriptionType = 'subscriptionType';
|
||||
|
||||
abstract public function addData(array $variables);
|
||||
|
||||
protected function setupSubscriptionTypeVariables(SubscriptionType $subscriptionType, Journal $context): void
|
||||
{
|
||||
$this->addData([
|
||||
static::$subscriptionUrl => $this->getSubscriptionUrl($subscriptionType, $context),
|
||||
static::$subscriptionType => $subscriptionType->getSummaryString(),
|
||||
]);
|
||||
}
|
||||
|
||||
protected static function addSubscriptionTypeVariablesDescription(array $variables): array
|
||||
{
|
||||
return array_merge(
|
||||
$variables,
|
||||
[
|
||||
static::$subscriptionUrl => __('emailTemplate.variable.subscription.subscriptionUrl'),
|
||||
static::$subscriptionType => __('emailTemplate.variable.subscription.subscriptionType'),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
protected function getSubscriptionUrl(SubscriptionType $subscriptionType, Journal $context): string
|
||||
{
|
||||
$application = Application::get();
|
||||
$request = $application->getRequest();
|
||||
$dispatcher = $application->getDispatcher();
|
||||
|
||||
return $dispatcher->url(
|
||||
$request,
|
||||
Application::ROUTE_PAGE,
|
||||
$context->getData('urlPath'),
|
||||
'payments',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$subscriptionType->getInstitutional() ? 'institutional' : 'individual',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/variables/ContextEmailVariable.php
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class ContextEmailVariable
|
||||
*
|
||||
* @ingroup mail_variables
|
||||
*
|
||||
* @brief Represents journal-specific email template variables
|
||||
*/
|
||||
|
||||
namespace APP\mail\variables;
|
||||
|
||||
use PKP\mail\variables\ContextEmailVariable as PKPContextEmailVariable;
|
||||
|
||||
class ContextEmailVariable extends PKPContextEmailVariable
|
||||
{
|
||||
public const CONTEXT_NAME = 'journalName';
|
||||
public const CONTEXT_URL = 'journalUrl';
|
||||
public const CONTEXT_SIGNATURE = 'journalSignature';
|
||||
public const CONTEXT_ACRONYM = 'journalAcronym';
|
||||
|
||||
/**
|
||||
* @copydoc Variable::descriptions()
|
||||
*/
|
||||
public static function descriptions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::descriptions(),
|
||||
[
|
||||
static::CONTEXT_ACRONYM => __('emailTemplate.variable.context.contextAcronym'),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @copydoc Variable::values()
|
||||
*/
|
||||
public function values(string $locale): array
|
||||
{
|
||||
$values = array_merge(
|
||||
parent::values($locale),
|
||||
[
|
||||
static::CONTEXT_ACRONYM => htmlspecialchars($this->context->getLocalizedData('acronym')),
|
||||
],
|
||||
);
|
||||
|
||||
// Pass the values into the context signature so variables
|
||||
// used in the signature can be rendered.
|
||||
$values[static::CONTEXT_SIGNATURE] = $this->getContextSignature($values);
|
||||
|
||||
return $values;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/variables/IssueEmailVariable.php
|
||||
*
|
||||
* Copyright (c) 2014-2023 Simon Fraser University
|
||||
* Copyright (c) 2000-2023 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class IssueEmailVariable
|
||||
*
|
||||
* @ingroup mail_variables
|
||||
*
|
||||
* @brief Email template variables for an issue.
|
||||
*/
|
||||
|
||||
namespace APP\mail\variables;
|
||||
|
||||
use APP\core\Application;
|
||||
use APP\issue\Issue;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\variables\Variable;
|
||||
|
||||
class IssueEmailVariable extends Variable
|
||||
{
|
||||
public const ISSUE_ID = 'issueId';
|
||||
public const ISSUE_IDENTIFICATION = 'issueIdentification';
|
||||
public const ISSUE_URL = 'issueUrl';
|
||||
|
||||
protected Issue $issue;
|
||||
|
||||
public function __construct(Issue $issue, Mailable $mailable)
|
||||
{
|
||||
parent::__construct($mailable);
|
||||
|
||||
$this->issue = $issue;
|
||||
}
|
||||
|
||||
public static function descriptions(): array
|
||||
{
|
||||
return
|
||||
[
|
||||
static::ISSUE_ID => __('emailTemplate.variable.issueId'),
|
||||
static::ISSUE_IDENTIFICATION => __('emailTemplate.variable.issue.issueIdentification'),
|
||||
static::ISSUE_URL => __('emailTemplate.variable.issue.issuePublishedUrl'),
|
||||
];
|
||||
}
|
||||
|
||||
public function values(string $locale): array
|
||||
{
|
||||
return
|
||||
[
|
||||
static::ISSUE_ID => $this->issue->getId(),
|
||||
static::ISSUE_IDENTIFICATION => htmlspecialchars($this->issue->getIssueIdentification()),
|
||||
static::ISSUE_URL => $this->getIssueUrl(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getIssueUrl(): string
|
||||
{
|
||||
return Application::get()->getDispatcher()->url(
|
||||
Application::get()->getRequest(),
|
||||
Application::ROUTE_PAGE,
|
||||
$this->getContext()->getPath(),
|
||||
'issue',
|
||||
'view',
|
||||
$this->issue->getBestIssueId()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/variables/SubmissionEmailVariable.php
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubmissionEmailVariable
|
||||
*
|
||||
* @ingroup mail_variables
|
||||
*
|
||||
* @brief Represents variables associated with a submission that can be assigned to a template
|
||||
*/
|
||||
|
||||
namespace APP\mail\variables;
|
||||
|
||||
use APP\core\Application;
|
||||
use PKP\context\Context;
|
||||
|
||||
class SubmissionEmailVariable extends \PKP\mail\variables\SubmissionEmailVariable
|
||||
{
|
||||
protected function getSubmissionPublishedUrl(Context $context): string
|
||||
{
|
||||
return Application::get()->getDispatcher()->url(
|
||||
Application::get()->getRequest(),
|
||||
Application::ROUTE_PAGE,
|
||||
$context->getPath(),
|
||||
'article',
|
||||
'view',
|
||||
$this->submission->getBestId()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file classes/mail/variables/SubscriptionEmailVariable.php
|
||||
*
|
||||
* Copyright (c) 2014-2022 Simon Fraser University
|
||||
* Copyright (c) 2000-2022 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* @class SubscriptionEmailVariable
|
||||
*
|
||||
* @ingroup mail_variables
|
||||
*
|
||||
* @brief Represents variables associated with a subscription
|
||||
*/
|
||||
|
||||
namespace APP\mail\variables;
|
||||
|
||||
use APP\facades\Repo;
|
||||
use APP\journal\Journal;
|
||||
use APP\subscription\Subscription;
|
||||
use PKP\core\PKPString;
|
||||
use PKP\mail\Mailable;
|
||||
use PKP\mail\variables\Variable;
|
||||
use PKP\user\User;
|
||||
|
||||
class SubscriptionEmailVariable extends Variable
|
||||
{
|
||||
public const SUBSCRIBER_DETAILS = 'subscriberDetails';
|
||||
public const SUBSCRIPTION_SIGNATURE = 'subscriptionSignature';
|
||||
public const EXPIRY_DATE = 'expiryDate';
|
||||
public const MEMBERSHIP = 'membership';
|
||||
|
||||
protected User $subscriber;
|
||||
protected Subscription $subscription;
|
||||
|
||||
public function __construct(Subscription $subscription, Mailable $mailable)
|
||||
{
|
||||
parent::__construct($mailable);
|
||||
|
||||
$this->subscriber = Repo::user()->get($subscription->getUserId());
|
||||
$this->subscription = $subscription;
|
||||
}
|
||||
|
||||
/**
|
||||
* @copydoc Variable::descriptions()
|
||||
*/
|
||||
public static function descriptions(): array
|
||||
{
|
||||
return
|
||||
[
|
||||
self::SUBSCRIBER_DETAILS => __('emailTemplate.variable.subscription.subscriberDetails'),
|
||||
self::SUBSCRIPTION_SIGNATURE => __('emailTemplate.variable.subscription.subscriptionSignature'),
|
||||
self::EXPIRY_DATE => __('emailTemplate.variable.subscription.expiryDate'),
|
||||
self::MEMBERSHIP => __('emailTemplate.variable.subscription.membership'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @copydoc Variable::values()
|
||||
*/
|
||||
public function values(string $locale): array
|
||||
{
|
||||
$context = $this->getContext();
|
||||
return
|
||||
[
|
||||
self::SUBSCRIBER_DETAILS => PKPString::stripUnsafeHtml($this->subscriber->getSignature($locale) ?? ''),
|
||||
self::SUBSCRIPTION_SIGNATURE => $this->getSubscriptionSignature($context),
|
||||
self::EXPIRY_DATE => $this->subscription->getDateEnd(),
|
||||
self::MEMBERSHIP => htmlspecialchars($this->subscription->getMembership()),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscription signature consisting of contact details of the person responsible for subscriptions included in the
|
||||
* context's Subscription Policies form, Subscription Manager section
|
||||
*/
|
||||
protected function getSubscriptionSignature(Journal $context): string
|
||||
{
|
||||
$subscriptionName = htmlspecialchars($context->getData('subscriptionName'));
|
||||
$subscriptionEmail = htmlspecialchars($context->getData('subscriptionEmail'));
|
||||
$subscriptionPhone = htmlspecialchars($context->getData('subscriptionPhone'));
|
||||
$subscriptionMailingAddress = PKPString::stripUnsafeHtml($context->getData('subscriptionMailingAddress'));
|
||||
$subscriptionContactSignature = $subscriptionName;
|
||||
|
||||
if ($subscriptionMailingAddress != '') {
|
||||
$subscriptionContactSignature .= "\n" . $subscriptionMailingAddress;
|
||||
}
|
||||
if ($subscriptionPhone != '') {
|
||||
$subscriptionContactSignature .= "\n" . __('user.phone') . ': ' . $subscriptionPhone;
|
||||
}
|
||||
|
||||
return $subscriptionContactSignature . "\n" . __('user.email') . ': ' . $subscriptionEmail;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user