Skip to content

Commit 4484fc9

Browse files
authored
MCLOUD-8643: Mailhog not catching emails in v1.3.0 / 1.3.1 (#92)
1 parent e56001f commit 4484fc9

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/Compose/DeveloperBuilder.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\CloudDocker\Config\Config;
1313
use Magento\CloudDocker\Config\Environment\Converter;
1414
use Magento\CloudDocker\Filesystem\FileList;
15+
use Magento\CloudDocker\Service\ServiceInterface;
1516

1617
/**
1718
* Developer compose configuration.
@@ -149,11 +150,18 @@ public function build(Config $config): Manager
149150
$dbVolumes
150151
)
151152
]);
153+
154+
$variables = [
155+
'MAGENTO_RUN_MODE' => 'developer',
156+
'PHP_EXTENSIONS' => implode(' ', $this->extensionResolver->get($config))
157+
];
158+
159+
if ($config->hasServiceEnabled(ServiceInterface::SERVICE_MAILHOG)) {
160+
$variables['SENDMAIL_PATH'] = '/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025';
161+
}
162+
152163
$manager->updateService(self::SERVICE_GENERIC, [
153-
'environment' => $this->converter->convert(array_merge(
154-
['MAGENTO_RUN_MODE' => 'developer'],
155-
['PHP_EXTENSIONS' => implode(' ', $this->extensionResolver->get($config))]
156-
))
164+
'environment' => $this->converter->convert($variables)
157165
]);
158166

159167
return $manager;

src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ services:
147147
environment:
148148
- MAGENTO_RUN_MODE=developer
149149
- 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis'
150+
- 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025'
150151
build:
151152
hostname: build.magento2.docker
152153
image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0'

src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ services:
127127
environment:
128128
- MAGENTO_RUN_MODE=developer
129129
- 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis'
130+
- 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025'
130131
build:
131132
hostname: build.magento2.docker
132133
image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0'

0 commit comments

Comments
 (0)