Load form templates data for template selection page from repository
[MAILPOET-2985]
This commit is contained in:
committed by
Veljko V
parent
14aa0b1393
commit
b4dc778230
@@ -23,7 +23,7 @@ class TemplateRepository {
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
public function getFormEntityForTemplate($templateId): FormEntity {
|
||||
public function getFormEntityForTemplate(string $templateId): FormEntity {
|
||||
if (!isset($this->templates[$templateId])) {
|
||||
throw UnexpectedValueException::create()
|
||||
->withErrors(["Template with id $templateId doesn't exist."]);
|
||||
@@ -39,6 +39,18 @@ class TemplateRepository {
|
||||
return $formEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $templateIds
|
||||
* @return FormEntity[] associative array with template ids as keys
|
||||
*/
|
||||
public function getFormsForTemplates(array $templateIds): array {
|
||||
$result = [];
|
||||
foreach ($templateIds as $templateId) {
|
||||
$result[$templateId] = $this->getFormEntityForTemplate($templateId);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function getDefaultSuccessMessage() {
|
||||
if ($this->settings->get('signup_confirmation.enabled')) {
|
||||
return __('Check your inbox or spam folder to confirm your subscription.', 'mailpoet');
|
||||
|
Reference in New Issue
Block a user