mailable = $mailable; } /** * Retrieve mailable context from associated variables, see pkp/pkp-lib#8204 */ protected function getContext(): Context { $contextEmailVariable = Arr::first($this->mailable->getVariables(), function (Variable $variable) { return $variable instanceof ContextEmailVariable; }); if (!$contextEmailVariable) { throw new Exception(static::class . ' is unable to generate email variables without providing the context to the Mailable'); } return $contextEmailVariable->getContextFromVariable(); } /** * Get descriptions of the variables provided by this class * * @return string[] */ abstract public static function descriptions(): array; /** * Get the value of variables supported by this class * * @return string[] */ abstract public function values(string $locale): array; }