Project

General

Profile

« Previous | Next » 

Revision 52897

add deployments info file
remove content page from init script
update names of communities
update html for pages with htmlPageContent

Subscribers: don't subscribe again if already subscribed
Notifications: add entity, DAO, controller
Add Email entity

Change emailSender to be more generic

View differences:

EmailSender.java
35 35
    @Value( "${admintool.from}" )
36 36
    private String from = null;
37 37

  
38
    public void send(List<String> recipients) {
38
    public void send(List<String> recipients, String subject, String body) {
39 39
        // Get system properties
40 40
        Properties properties = System.getProperties();
41 41
        properties.setProperty("mail.smtp.host", host);
......
51 51
                });
52 52

  
53 53
        try {
54
            logger.debug("Try to sent e-mail to "+recipients.toString()+
55
            "\nSubject: "+subject+
56
            "\nBody:"+body);
57

  
54 58
            // Create a default MimeMessage object.
55 59
            MimeMessage message = new MimeMessage(session);
56 60

  
......
59 63

  
60 64
            // Set To: header field of the header.
61 65
            for(String to : recipients) {
62
                message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
66
                message.addRecipient(Message.RecipientType.BCC, new InternetAddress(to));
63 67
            }
64

  
65 68
            // Set Subject: header field
66
            message.setSubject("Join Openaire!");
69
            message.setSubject(subject);
67 70

  
68 71
            // For simple text setText() can be used instead of setContent()
69 72

  
70 73
            // Send the actual HTML message, as big as you like
71
            message.setContent("Test email", "text/html");
74
            message.setContent(body, "text/html");
72 75

  
73 76
            // Send message
74 77
            Transport.send(message);

Also available in: Unified diff