Skip to content
Snippets Groups Projects
Verified Commit f45eff79 authored by Jordi Gómez's avatar Jordi Gómez
Browse files

refactor: moving MailerConfig to the config folder

parent d7d9c4a1
No related branches found
No related tags found
1 merge request!221feat: adding email notification when certian revalidation threshold is met
Pipeline #70283 passed
package org.eclipsefoundation.git.eca.service.impl; /**
* Copyright (c) 2025 Eclipse Foundation
*
* This program and the accompanying materials are made available under the terms of the Eclipse
* Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Jordi Gómez <jordi.gomez@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipsefoundation.git.eca.config;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
...@@ -12,7 +22,7 @@ import io.smallrye.config.ConfigMapping; ...@@ -12,7 +22,7 @@ import io.smallrye.config.ConfigMapping;
* *
*/ */
@ConfigMapping(prefix = "eclipse.mailer") @ConfigMapping(prefix = "eclipse.mailer")
public interface EclipseMailerConfig { public interface MailerConfig {
public RevalidationAlert revalidationAlert(); public RevalidationAlert revalidationAlert();
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
*/ */
package org.eclipsefoundation.git.eca.service.impl; package org.eclipsefoundation.git.eca.service.impl;
import org.eclipsefoundation.git.eca.config.MailerConfig;
import org.eclipsefoundation.git.eca.dto.GithubWebhookTracking; import org.eclipsefoundation.git.eca.dto.GithubWebhookTracking;
import org.eclipsefoundation.git.eca.service.MailerService; import org.eclipsefoundation.git.eca.service.MailerService;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -24,13 +25,13 @@ import jakarta.enterprise.context.ApplicationScoped; ...@@ -24,13 +25,13 @@ import jakarta.enterprise.context.ApplicationScoped;
@ApplicationScoped @ApplicationScoped
public class DefaultMailerService implements MailerService { public class DefaultMailerService implements MailerService {
public static final Logger LOGGER = LoggerFactory.getLogger(DefaultMailerService.class); public static final Logger LOGGER = LoggerFactory.getLogger(DefaultMailerService.class);
private final EclipseMailerConfig config; private final MailerConfig config;
private final Mailer mailer; private final Mailer mailer;
@Location("emails/revalidation_alert") @Location("emails/revalidation_alert")
Template revalidationAlertTemplate; Template revalidationAlertTemplate;
public DefaultMailerService(EclipseMailerConfig config, Mailer mailer) { public DefaultMailerService(MailerConfig config, Mailer mailer) {
this.config = config; this.config = config;
this.mailer = mailer; this.mailer = mailer;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment