Skip to content

Commit

Permalink
Prestashop 1.7.7.* doesn't list the sender addresses under the home m…
Browse files Browse the repository at this point in the history
…enu.

## Description
- Fixed issue with displaying list of senders on the home screen of Mailjet module
  • Loading branch information
oleksandr-mykhailenko committed Jun 2, 2022
1 parent a9ac02d commit 65fd574
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ translations/translation_*
config_*.xml
backward_compatibility
/nbproject/*
logs/*.log
2 changes: 1 addition & 1 deletion classes/MailJetTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function __construct()
/**
* Get the api connection
* @static
* @return null
* @return Mailjet_ApiOverlay|Mailjet_Api|null
*/
public static function getApi($with_overlay = true)
{
Expand Down
8 changes: 8 additions & 0 deletions mailjet.php
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,12 @@ public function getContent()
}
$tab = ['class_name' => 'AdminModules'];
$link = $this->context->link->getTabLink($tab) . '&configure=' . $this->name . '&conf=4&token=' . Tools::getAdminTokenLite('AdminModules') . '&sync_list=true';

$api = MailjetTemplate::getApi();
$infos = $api->getUser();
$mjSenders = $api->getSenders(null, $infos);
$currentSender = Configuration::get('PS_SHOP_EMAIL');

$this->context->smarty->assign(array(
'MJ_templates' => $this->mj_template->getTemplates(),
'MJ_iframes' => $this->mj_template->getIframesURL(),
Expand All @@ -1489,6 +1495,8 @@ public function getContent()
'MJ_adminmodules_link' => $this->getAdminModuleLink(array()),
'MJ_REQUEST_PAGE_TYPE' => MailJetPages::REQUEST_PAGE_TYPE,
'MJ_sync_url' => $link,
'mjSenders' => $this->getOnlyEmailSenders($mjSenders),
'currentSender' => $currentSender,
));
if ($this->page_name == 'CONTACTS') {
$this->context->smarty->assign([
Expand Down

0 comments on commit 65fd574

Please sign in to comment.