ing
This commit is contained in:
parent
856ec27cda
commit
6d9d8b5b78
2
pom.xml
2
pom.xml
|
@ -216,7 +216,7 @@
|
|||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources/${environment}</directory>
|
||||
<directory>src/main/resources/${activatedProperties}</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
|
|
|
@ -39,13 +39,25 @@ public class EmailSender {
|
|||
|
||||
public void sendSimpleEmail(Mail mail) throws MailException {
|
||||
|
||||
SimpleMailMessage message1 = new SimpleMailMessage();
|
||||
message1.setTo(mail.getMailTo());
|
||||
message1.setSubject(mail.getMailSubject());
|
||||
message1.setText(getContentFromTemplate(mail.getModel(), mail));
|
||||
message1.setFrom("geek@loafle.com");
|
||||
// SimpleMailMessage message1 = new SimpleMailMessage();
|
||||
// message1.setTo(mail.getMailTo());
|
||||
// message1.setSubject(mail.getMailSubject());
|
||||
// message1.setText(getContentFromTemplate(mail.getModel(), mail));
|
||||
// message1.setFrom("geek@loafle.com");
|
||||
// mailSender.send(message1);
|
||||
|
||||
mailSender.send(message1);
|
||||
MimeMessage msg = this.mailSender.createMimeMessage();
|
||||
|
||||
try {
|
||||
MimeMessageHelper helper = new MimeMessageHelper(msg, false);
|
||||
helper.setTo(mail.getMailTo());
|
||||
helper.setFrom("geek@loafle.com");
|
||||
helper.setSubject(mail.getMailSubject());
|
||||
helper.setText(getContentFromTemplate(mail.getModel(), mail), true);
|
||||
this.mailSender.send(msg);
|
||||
} catch (MessagingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void sendMailWithAttachment(Mail mail) throws MessagingException {
|
||||
|
|
|
@ -182,11 +182,11 @@ public class EmailAuthService {
|
|||
if (status == 1) {
|
||||
mailSubject = "Signup Confirm Mail";
|
||||
entry = "confirm_signup";
|
||||
templateName = "./vmtemplates/signup.vm";
|
||||
templateName = "/vmtemplates/signup.vm";
|
||||
} else if (status == 2) {
|
||||
mailSubject = "Reset Password Confirm Mail";
|
||||
entry = "confirm_reset_pw";
|
||||
templateName = "./vmtemplates/password_reset.vm";
|
||||
templateName = "/vmtemplates/password_reset.vm";
|
||||
}
|
||||
|
||||
Mail mail = new Mail();
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
resource.loader=jar
|
||||
jar.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
|
||||
jar.runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
|
||||
jar.runtime.log.logsystem.log4j.category=velocity
|
||||
jar.resource.loader.cache=true
|
||||
#resource.loader=jar
|
||||
#jar.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
|
||||
#jar.runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
|
||||
#jar.runtime.log.logsystem.log4j.category=velocity
|
||||
#jar.resource.loader.cache=true
|
||||
resource.loader=class
|
||||
class.resource.loader.class = org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
|
||||
class.runtime.log.logsystem.log4j.category=velocity
|
||||
|
||||
input.encoding=UTF-8
|
Loading…
Reference in New Issue
Block a user