src/Service/Factory/MailServiceAbstractFactory.php
public function canCreate(ContainerInterface $container, $requestedName): bool
    {
        $parts = explode('.', $requestedName);
        if (count($parts) !== 3) {
            return false;
        }

        if ($parts[0] !== self::ACMAILER_PART || $parts[1] !== static::MAIL_SERVICE_PART) {
            return false;
        }

        $specificServiceName = $parts[2];
        $config = $container->get('config')['acmailer_options']['mail_services'] ?? [];
        return array_key_exists($specificServiceName, $config);
    }
public function canCreate(ContainerInterface $container, $requestedName): bool
    {
        $parts = explode('.', $requestedName);
        if (count($parts) !== 3) {
            return false;
        }

        if ($parts[0] !== self::ACMAILER_PART || $parts[1] !== static::MAIL_SERVICE_PART) {
            return false;
        }

        $specificServiceName = $parts[2];
        $config = $container->get('config')['acmailer_options']['mail_services'] ?? [];
        return array_key_exists($specificServiceName, $config);
    }
Can the factory create an instance for the service?

@param  ContainerInterface $container
@param  string $requestedName
@return bool
@throws ContainerExceptionInterface