getNextLink();
+ String getToken();
+
void validate(String token);
boolean isValidated();
diff --git a/src/main/groovy/io/kamax/mxisd/threepid/session/ThreePidSession.java b/src/main/groovy/io/kamax/mxisd/threepid/session/ThreePidSession.java
index 8d0fcbc..4b37358 100644
--- a/src/main/groovy/io/kamax/mxisd/threepid/session/ThreePidSession.java
+++ b/src/main/groovy/io/kamax/mxisd/threepid/session/ThreePidSession.java
@@ -113,6 +113,11 @@ public class ThreePidSession implements IThreePidSession {
return Optional.ofNullable(nextLink);
}
+ @Override
+ public String getToken() {
+ return token;
+ }
+
public synchronized void setAttempt(int attempt) {
if (isValidated()) {
throw new IllegalStateException();
diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml
index 8dc80b6..82c1fec 100644
--- a/src/main/resources/application.yaml
+++ b/src/main/resources/application.yaml
@@ -63,18 +63,25 @@ forward:
- "https://vector.im"
threepid:
- email:
- connector:
- active: 'smtp'
- provider:
- smtp:
- port: 587
- tls: 1
-
-invite:
medium:
email:
- template: 'classpath:email/invite-template.eml'
+ identity:
+ from: ''
+ name: ''
+ connector: 'smtp'
+ generator: 'template'
+ connectors:
+ smtp:
+ host: ''
+ port: 587
+ tls: 1
+ login: ''
+ password: ''
+ generators:
+ template:
+ invite: 'classpath:email/invite-template.eml'
+ session:
+ validation: 'classpath:email/validate-template.eml'
storage:
backend: 'sqlite'
diff --git a/src/main/resources/email/validate-template.eml b/src/main/resources/email/validate-template.eml
new file mode 100644
index 0000000..0761712
--- /dev/null
+++ b/src/main/resources/email/validate-template.eml
@@ -0,0 +1,66 @@
+Subject: Your Matrix Validation Token
+MIME-Version: 1.0
+Content-Type: multipart/alternative;
+ boundary="7REaIwWQCioQ6NaBlAQlg8ztbUQj6PKJ"
+
+--7REaIwWQCioQ6NaBlAQlg8ztbUQj6PKJ
+Content-Type: text/plain; charset=UTF-8
+Content-Disposition: inline
+
+Hello,
+
+We have received a request to link this email address with a Matrix account.
+If this was you who made this request, you may use the following link to complete the verification of your email address:
+
+ %VALIDATION_LINK%
+
+If your client requires a code, the code is %VALIDATION_TOKEN%
+
+If you aren't aware of making such a request, please disregard this email.
+
+Regards,
+%DOMAIN_PRETTY% Admins
+
+--7REaIwWQCioQ6NaBlAQlg8ztbUQj6PKJ
+Content-Type: text/html; charset=UTF-8
+Content-Disposition: inline
+
+
+
+
+
+
+
+
+
+Hello,
+
+We have received a request to link this email address with a Matrix account.
+ If this was you who made this request, you may use the following link to
+ complete the verification of your email address:
+
+Complete email verification
+
+...or copy this link into your web browser:
+
+%VALIDATION_LINK%
+
+If your client requires a code, the code is %VALIDATION_TOKEN%
+
+If you aren't aware of making such a request, please disregard this
+email.
+
+
+Regards,
+ %DOMAIN_PRETTY% Admins
+
+
+
+
+--7REaIwWQCioQ6NaBlAQlg8ztbUQj6PKJ--