Class MailService
- java.lang.Object
-
- com.netgrif.application.engine.mail.MailService
-
- All Implemented Interfaces:
IMailService
@Service public class MailService extends java.lang.Object implements IMailService
-
-
Field Summary
Fields Modifier and Type Field Description protected freemarker.template.Configurationconfigurationprotected java.lang.Stringdomainstatic java.lang.StringEXPIRATIONprotected java.lang.StringmailFromprotected org.springframework.mail.javamail.JavaMailSendermailSenderstatic java.lang.StringNAMEprotected java.lang.Stringportstatic java.lang.StringSERVERprotected booleansslstatic java.lang.StringTOKENstatic java.lang.StringVALIDITY
-
Constructor Summary
Constructors Constructor Description MailService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.mail.internet.MimeMessagebuildEmail(MailDraft draft)protected java.lang.StringgetServerURL()voidsendMail(MailDraft mailDraft)voidsendPasswordResetEmail(RegisteredUser user)voidsendRegistrationEmail(RegisteredUser user)voidtestConnection()
-
-
-
Field Detail
-
TOKEN
public static final java.lang.String TOKEN
- See Also:
- Constant Field Values
-
VALIDITY
public static final java.lang.String VALIDITY
- See Also:
- Constant Field Values
-
EXPIRATION
public static final java.lang.String EXPIRATION
- See Also:
- Constant Field Values
-
SERVER
public static final java.lang.String SERVER
- See Also:
- Constant Field Values
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
port
@Value("${nae.mail.redirect-to.port}") protected java.lang.String port
-
domain
@Value("${nae.mail.redirect-to.host}") protected java.lang.String domain
-
ssl
@Value("${nae.mail.redirect-to.ssl}") protected boolean ssl
-
mailFrom
@Value("${nae.mail.from}") protected java.lang.String mailFrom
-
mailSender
protected org.springframework.mail.javamail.JavaMailSender mailSender
-
configuration
protected freemarker.template.Configuration configuration
-
-
Method Detail
-
sendRegistrationEmail
public void sendRegistrationEmail(RegisteredUser user) throws javax.mail.MessagingException, java.io.IOException, freemarker.template.TemplateException
- Specified by:
sendRegistrationEmailin interfaceIMailService- Throws:
javax.mail.MessagingExceptionjava.io.IOExceptionfreemarker.template.TemplateException
-
sendPasswordResetEmail
public void sendPasswordResetEmail(RegisteredUser user) throws javax.mail.MessagingException, java.io.IOException, freemarker.template.TemplateException
- Specified by:
sendPasswordResetEmailin interfaceIMailService- Throws:
javax.mail.MessagingExceptionjava.io.IOExceptionfreemarker.template.TemplateException
-
testConnection
public void testConnection()
- Specified by:
testConnectionin interfaceIMailService
-
sendMail
public void sendMail(MailDraft mailDraft) throws javax.mail.MessagingException, java.io.IOException, freemarker.template.TemplateException
- Specified by:
sendMailin interfaceIMailService- Throws:
javax.mail.MessagingExceptionjava.io.IOExceptionfreemarker.template.TemplateException
-
buildEmail
protected javax.mail.internet.MimeMessage buildEmail(MailDraft draft) throws javax.mail.MessagingException, java.io.IOException, freemarker.template.TemplateException
- Throws:
javax.mail.MessagingExceptionjava.io.IOExceptionfreemarker.template.TemplateException
-
getServerURL
protected java.lang.String getServerURL()
-
-