model = new HashMap<>();
+ model.put("firstName", auth.getMember().getName());
+ model.put("lastName", auth.getMember().getCompanyName());
+ model.put("location", "Seoul");
+ model.put("signature", "www.loafle.com");
+
+ mail.setModel(model);
+ emailSender.sendSimpleEmail(mail);
this.emailAuthDAO.save(auth);
diff --git a/src/main/java/com/loafle/overflow/module/member/service/MemberService.java b/src/main/java/com/loafle/overflow/module/member/service/MemberService.java
index c96992d..827499a 100644
--- a/src/main/java/com/loafle/overflow/module/member/service/MemberService.java
+++ b/src/main/java/com/loafle/overflow/module/member/service/MemberService.java
@@ -70,7 +70,8 @@ public class MemberService {
}
m.setSigninFailCount(m.getSigninFailCount()+1);
this.modify(m);
- throw new SignInPwNotMatchException();
+// throw new SignInPwNotMatchException();
+ return null;
}
m.setSigninFailCount(0);
diff --git a/src/main/java/com/loafle/overflow/spring/MailConfiguration.java b/src/main/java/com/loafle/overflow/spring/MailConfiguration.java
index 2781511..66cda61 100644
--- a/src/main/java/com/loafle/overflow/spring/MailConfiguration.java
+++ b/src/main/java/com/loafle/overflow/spring/MailConfiguration.java
@@ -1,11 +1,15 @@
package com.loafle.overflow.spring;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.exception.VelocityException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSenderImpl;
+import org.springframework.ui.velocity.VelocityEngineFactory;
+import java.io.IOException;
import java.util.Properties;
/**
@@ -54,6 +58,14 @@ public class MailConfiguration {
return javaMailProperties;
}
+
+ @Bean
+ public VelocityEngine getVelocityEngine() throws VelocityException, IOException {
+ Properties properties = new Properties();
+ properties.load(this.getClass().getResourceAsStream("/velocity.properties"));
+ return new VelocityEngine(properties);
+ }
+
}
//
diff --git a/src/main/resources/local/init.sql b/src/main/resources/local/init.sql
index 800f903..7e9a220 100644
--- a/src/main/resources/local/init.sql
+++ b/src/main/resources/local/init.sql
@@ -864,6 +864,9 @@ INSERT INTO public."member" (company_name,create_date,email,"name",phone,pw,stat
INSERT INTO public.email_auth (auth_confirm_date,create_date,email_auth_key,member_id) VALUES (
NULL,'2017-06-26 15:28:48.895','dbseogns1234',1);
+INSERT INTO public.email_auth (auth_confirm_date,create_date,email_auth_key,member_id) VALUES (
+NULL,'2017-11-22 12:28:48.895','dbseogns1234',1);
+
INSERT INTO public."domain" (create_date,"name") VALUES (
'2017-06-26 11:25:44.866','overFlow''s domain');
diff --git a/src/main/resources/local/velocity.properties b/src/main/resources/local/velocity.properties
new file mode 100644
index 0000000..c298824
--- /dev/null
+++ b/src/main/resources/local/velocity.properties
@@ -0,0 +1,6 @@
+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
+input.encoding=UTF-8
\ No newline at end of file
diff --git a/src/main/resources/signup_email.vm b/src/main/resources/signup_email.vm
new file mode 100644
index 0000000..ac6dcf3
--- /dev/null
+++ b/src/main/resources/signup_email.vm
@@ -0,0 +1,13 @@
+
+
+
+
+
+Dear ${firstName} ${lastName},
+Sending Email Velocity Template Test !!!
+Thanks
+${signature}
+${location}
+
+
+
\ No newline at end of file