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.Configuration
configuration
protected java.lang.String
domain
static java.lang.String
EXPIRATION
protected java.lang.String
mailFrom
protected org.springframework.mail.javamail.JavaMailSender
mailSender
static java.lang.String
NAME
protected java.lang.String
port
static java.lang.String
SERVER
protected boolean
ssl
static java.lang.String
TOKEN
static java.lang.String
VALIDITY
-
Constructor Summary
Constructors Constructor Description MailService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.mail.internet.MimeMessage
buildEmail(MailDraft draft)
protected java.lang.String
getServerURL()
void
sendMail(MailDraft mailDraft)
void
sendPasswordResetEmail(RegisteredUser user)
void
sendRegistrationEmail(RegisteredUser user)
void
testConnection()
-
-
-
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:
sendRegistrationEmail
in interfaceIMailService
- Throws:
javax.mail.MessagingException
java.io.IOException
freemarker.template.TemplateException
-
sendPasswordResetEmail
public void sendPasswordResetEmail(RegisteredUser user) throws javax.mail.MessagingException, java.io.IOException, freemarker.template.TemplateException
- Specified by:
sendPasswordResetEmail
in interfaceIMailService
- Throws:
javax.mail.MessagingException
java.io.IOException
freemarker.template.TemplateException
-
testConnection
public void testConnection()
- Specified by:
testConnection
in interfaceIMailService
-
sendMail
public void sendMail(MailDraft mailDraft) throws javax.mail.MessagingException, java.io.IOException, freemarker.template.TemplateException
- Specified by:
sendMail
in interfaceIMailService
- Throws:
javax.mail.MessagingException
java.io.IOException
freemarker.template.TemplateException
-
buildEmail
protected javax.mail.internet.MimeMessage buildEmail(MailDraft draft) throws javax.mail.MessagingException, java.io.IOException, freemarker.template.TemplateException
- Throws:
javax.mail.MessagingException
java.io.IOException
freemarker.template.TemplateException
-
getServerURL
protected java.lang.String getServerURL()
-
-