import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.beans.factory.annotation.Autowired;
public class EmailNotificationDelegate implements JavaDelegate {
@Autowired
private JavaMailSender mailSender;
@Override
public void execute(DelegateExecution execution) throws Exception {
SimpleMailMessage message = new SimpleMailMessage();
message.setTo("recipient@example.com");
message.setSubject("Task Notification");
message.setText("A new task has been assigned to you.");
mailSender.send(message);
}
}