@Bean
    @ConditionalOnMissingBean(name = EmailSender.BEAN_NAME)
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    public EmailSender emailSender(
        final ConfigurableApplicationContext applicationContext,
        final ObjectProvider<List<EmailSenderCustomizer>> customizers,
        final MailProperties mailProperties,
        final ObjectProvider<SslBundles> sslBundles,
        @Qualifier(TenantExtractor.BEAN_NAME)
        final TenantExtractor tenantExtractor,
        @Qualifier("messageSource")
        final MessageSource messageSource) {
        val emailSenderCustomizers = Optional.ofNullable(customizers.getIfAvailable())
            .orElseGet(ArrayList::new)
            .stream()
            .filter(BeanSupplier::isNotProxy)
            .sorted(AnnotationAwareOrderComparator.INSTANCE)
            .toList();
        return new DefaultEmailSender(messageSource, applicationContext,
            emailSenderCustomizers, mailProperties, sslBundles, tenantExtractor);
    }
This is {@link CasCoreNotificationsAutoConfiguration}.

@author Misagh Moayyed
@since 5.0.0
core/cas-server-core-notifications/src/main/java/org/apereo/cas/config/CasCoreNotificationsAutoConfiguration.java