diff --git a/application/Espo/Modules/Crm/EntryPoints/SubscribeAgain.php b/application/Espo/Modules/Crm/EntryPoints/SubscribeAgain.php index 80917b5884..f15aa5ac09 100644 --- a/application/Espo/Modules/Crm/EntryPoints/SubscribeAgain.php +++ b/application/Espo/Modules/Crm/EntryPoints/SubscribeAgain.php @@ -88,12 +88,12 @@ class SubscribeAgain extends \Espo\Core\EntryPoints\Base } $link = null; - $m = array( + $m = [ 'Account' => 'accounts', 'Contact' => 'contacts', 'Lead' => 'leads', 'User' => 'users' - ); + ]; if (!empty($m[$target->getEntityType()])) { $link = $m[$target->getEntityType()]; } @@ -115,7 +115,11 @@ class SubscribeAgain extends \Espo\Core\EntryPoints\Base } $data = [ - 'queueItemId' => $queueItemId + 'actionData' => [ + 'queueItemId' => $queueItemId, + ], + 'view' => $this->getMetadata()->get(['clientDefs', 'Campaign', 'subscribeView']), + 'template' => $this->getMetadata()->get(['clientDefs', 'Campaign', 'subscribeTemplate']), ]; $runScript = " diff --git a/application/Espo/Modules/Crm/EntryPoints/Unsubscribe.php b/application/Espo/Modules/Crm/EntryPoints/Unsubscribe.php index cbb6a52d84..abe2e405e8 100644 --- a/application/Espo/Modules/Crm/EntryPoints/Unsubscribe.php +++ b/application/Espo/Modules/Crm/EntryPoints/Unsubscribe.php @@ -88,12 +88,12 @@ class Unsubscribe extends \Espo\Core\EntryPoints\Base } $link = null; - $m = array( + $m = [ 'Account' => 'accounts', 'Contact' => 'contacts', 'Lead' => 'leads', 'User' => 'users' - ); + ]; if (!empty($m[$target->getEntityType()])) { $link = $m[$target->getEntityType()]; } @@ -115,7 +115,11 @@ class Unsubscribe extends \Espo\Core\EntryPoints\Base } $data = [ - 'queueItemId' => $queueItemId + 'actionData' => [ + 'queueItemId' => $queueItemId, + ], + 'view' => $this->getMetadata()->get(['clientDefs', 'Campaign', 'unsubscribeView']), + 'template' => $this->getMetadata()->get(['clientDefs', 'Campaign', 'unsubscribeTemplate']), ]; $runScript = " @@ -137,4 +141,3 @@ class Unsubscribe extends \Espo\Core\EntryPoints\Base } } } - diff --git a/client/modules/crm/src/controllers/unsubscribe.js b/client/modules/crm/src/controllers/unsubscribe.js index 878a82a60d..d69a361077 100644 --- a/client/modules/crm/src/controllers/unsubscribe.js +++ b/client/modules/crm/src/controllers/unsubscribe.js @@ -31,22 +31,26 @@ Espo.define('crm:controllers/unsubscribe', 'controller', function (Dep) { return Dep.extend({ actionUnsubscribe: function (data) { - var viewName = this.getMetadata().get(['clientDefs', 'Campaign', 'unsubscribeView']) || - 'crm:views/campaign/unsubscribe'; + var viewName = data.view || 'crm:views/campaign/unsubscribe'; + + var template = this.getMetadata().get(['clientDefs', 'Campaign', 'unsubscribeTemplate']); this.entire(viewName, { - actionData: data + actionData: data.actionData, + template: data.template, }, function (view) { view.render(); }); }, actionSubscribeAgain: function (data) { - var viewName = this.getMetadata().get(['clientDefs', 'Campaign', 'subscribeAgainView']) || - 'crm:views/campaign/subscribe-again'; + var viewName = data.view || 'crm:views/campaign/subscribe-again'; + + var template = this.getMetadata().get(['clientDefs', 'Campaign', 'subscribeTemplate']); this.entire(viewName, { - actionData: data + actionData: data.actionData, + template: data.template, }, function (view) { view.render(); });