Configuration/FormConfigurationFactory.php
private function buildWebsiteMailConfigurationByTypeAndData(AbstractType $type, $formData, $locale, $attributes)
    {
        if ($type->getCustomerDeactivateMails($formData)) {
            return null;
        }

        $websiteMailConfiguration = $this->createMailConfiguration($locale);

        $websiteMailConfiguration->setSubject($type->getCustomerSubject($formData));
        $websiteMailConfiguration->setFrom($type->getCustomerFromMailAddress($formData));
        $websiteMailConfiguration->setTo($type->getCustomerToMailAddress($formData));
        $websiteMailConfiguration->setReplyTo($type->getCustomerReplyToMailAddress($formData));
        $websiteMailConfiguration->setAddAttachments(false); // Currently not implemented in the AbstractType.
        $websiteMailConfiguration->setTemplate($type->getCustomerMail($formData));
        $websiteMailConfiguration->setTemplateAttributes($attributes);

        return $websiteMailConfiguration;
    }
private function buildWebsiteMailConfigurationByTypeAndData(AbstractType $type, $formData, $locale, $attributes)
    {
        if ($type->getCustomerDeactivateMails($formData)) {
            return null;
        }

        $websiteMailConfiguration = $this->createMailConfiguration($locale);

        $websiteMailConfiguration->setSubject($type->getCustomerSubject($formData));
        $websiteMailConfiguration->setFrom($type->getCustomerFromMailAddress($formData));
        $websiteMailConfiguration->setTo($type->getCustomerToMailAddress($formData));
        $websiteMailConfiguration->setReplyTo($type->getCustomerReplyToMailAddress($formData));
        $websiteMailConfiguration->setAddAttachments(false); // Currently not implemented in the AbstractType.
        $websiteMailConfiguration->setTemplate($type->getCustomerMail($formData));
        $websiteMailConfiguration->setTemplateAttributes($attributes);

        return $websiteMailConfiguration;
    }
Build admin mail configuration by type.

@param AbstractType $type
@param mixed $formData
@param string $locale
@param array $attributes

@return MailConfiguration|null