Ignore:
Timestamp:
09/04/21 11:14:25 (3 years ago)
Author:
NikolaCenevski <cenevskinikola@…>
Branches:
master
Children:
ab49338
Parents:
194776a
Message:

Dodadeno posts to be approved

Location:
src/main/java/it/finki/charitable/services
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/it/finki/charitable/services/DonationPostService.java

    r194776a r5306751  
    4141    }
    4242
     43    public List<DonationPost> findAllByApproved(Boolean approved) {
     44        return donationPostRepository.findAllByApproved(approved);
     45    }
     46
    4347    public void delete(DonationPost donationPost) {
    4448        donationPostRepository.delete(donationPost);
  • src/main/java/it/finki/charitable/services/EmailService.java

    r194776a r5306751  
    2424        javaMailSender.send(message);
    2525    }
     26
     27    public void sendApprovalEmail(String to, String subject, Long postId) {
     28        SimpleMailMessage message = new SimpleMailMessage();
     29        message.setTo(to);
     30        message.setSubject(subject);
     31
     32        String text = "Your post has been approved\n" + "http://localhost:8080/post?postid=" + postId;
     33        message.setText(text);
     34        javaMailSender.send(message);
     35    }
     36
     37    public void sendNoApprovalEmail(String to, String subject, String description) {
     38        SimpleMailMessage message = new SimpleMailMessage();
     39        message.setTo(to);
     40        message.setSubject(subject);
     41
     42        String text = "Sorry, your post hasn't been approved" + "\n" +
     43                "Moderator:\n" + description;
     44        message.setText(text);
     45        javaMailSender.send(message);
     46    }
    2647}
Note: See TracChangeset for help on using the changeset viewer.