Package org.salespointframework.support
Class RecordingMailSender
- java.lang.Object
-
- org.salespointframework.support.ConsoleWritingMailSender
-
- org.salespointframework.support.RecordingMailSender
-
- All Implemented Interfaces:
org.springframework.mail.MailSender
public class RecordingMailSender extends ConsoleWritingMailSender
AMailSender
implementation that allows looking up allSimpleMailMessage
s that have been sent. Will also log the messages as they are received for sending. The required setup steps can be found inConsoleWritingMailSender
's JavaDoc.- Since:
- 6.3.1
- Author:
- Oliver Gierke
-
-
Constructor Summary
Constructors Constructor Description RecordingMailSender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.data.util.Streamable<org.springframework.mail.SimpleMailMessage>
getSentMessages()
Returns allSimpleMailMessage
s that have been recorded so far.void
send(org.springframework.mail.SimpleMailMessage simpleMessage)
-
Methods inherited from class org.salespointframework.support.ConsoleWritingMailSender
send
-
-
-
-
Method Detail
-
send
public void send(org.springframework.mail.SimpleMailMessage simpleMessage) throws org.springframework.mail.MailException
- Specified by:
send
in interfaceorg.springframework.mail.MailSender
- Overrides:
send
in classConsoleWritingMailSender
- Throws:
org.springframework.mail.MailException
-
getSentMessages
public org.springframework.data.util.Streamable<org.springframework.mail.SimpleMailMessage> getSentMessages()
Returns allSimpleMailMessage
s that have been recorded so far.- Returns:
- will never be null.
-
-