File tree Expand file tree Collapse file tree 1 file changed +2
-28
lines changed
src/main/java/com/olegshan/notifier Expand file tree Collapse file tree 1 file changed +2
-28
lines changed Original file line number Diff line number Diff line change 1
1
package com .olegshan .notifier ;
2
2
3
- import org .slf4j .Logger ;
4
- import org .slf4j .LoggerFactory ;
5
- import org .springframework .beans .factory .annotation .Autowired ;
6
- import org .springframework .mail .MailSender ;
7
- import org .springframework .mail .SimpleMailMessage ;
8
- import org .springframework .stereotype .Service ;
3
+ public interface Notifier {
9
4
10
- @ Service
11
- public class Notifier {
12
-
13
- private static final Logger LOGGER = LoggerFactory .getLogger (Notifier .class );
14
-
15
- private MailSender mailSender ;
16
-
17
- @ Autowired
18
- public Notifier (MailSender mailSender ) {
19
- this .mailSender = mailSender ;
20
- }
21
-
22
- public void notifyAdmin (String issue ) {
23
-
24
- SimpleMailMessage message = new SimpleMailMessage ();
25
- message .setTo ("***" );
26
- message .setSubject ("jParser issue" );
27
- message .setText (issue + "\n \n http://www.jparser.info" );
28
-
29
- mailSender .send (message );
30
- LOGGER .info ("Admin was notified about following issue: " + issue + "\n " );
31
- }
5
+ void notifyAdmin (String issue );
32
6
}
You can’t perform that action at this time.
0 commit comments