23 lines
649 B
Java
23 lines
649 B
Java
package com.srsystem.service.notification;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@Service
|
|
@Slf4j
|
|
public class EmailSender {
|
|
|
|
@Value("${notification.email.enabled:false}")
|
|
private boolean emailEnabled;
|
|
|
|
public void send(String to, String subject, String body) {
|
|
if (!emailEnabled) {
|
|
log.debug("Email notification disabled, skipping");
|
|
return;
|
|
}
|
|
// TODO: Implement JavaMailSender or external email API
|
|
log.info("Email notification sent: to={}, subject={}", to, subject);
|
|
}
|
|
}
|