]> WPIA git - gigi.git/commitdiff
upd: fix wording for emails to have the same end of all mails
authorINOPIAE <m.maengel@inopiae.de>
Fri, 12 Aug 2016 12:34:03 +0000 (14:34 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sat, 13 Aug 2016 23:10:22 +0000 (01:10 +0200)
Change-Id: I7c5dc16160b096680247bb75a8acb65e1a2f1bbf

src/org/cacert/gigi/email/MailProbe.templ
src/org/cacert/gigi/output/template/MailFooter.templ [new file with mode: 0644]
src/org/cacert/gigi/output/template/MailTemplate.java
src/org/cacert/gigi/pages/PasswordResetMail.templ
src/org/cacert/gigi/util/VerificationEntered.templ
tests/org/cacert/gigi/template/TestTemplateMail.java

index 5757f755306427d5c1c5f0dafb7bf5f02ffbcb24..5398c6d882564977d02183f4cc9cb1dc29bbff2a 100644 (file)
@@ -3,7 +3,3 @@ Subject: <?=_Mail Probe?>
 <?=_Thanks for signing up with SomeCA.org, below is the link you need to open to verify your account. Once your account is verified you will be able to start issuing certificates to your heart's content!?>
 
 <?=$link?>
 <?=_Thanks for signing up with SomeCA.org, below is the link you need to open to verify your account. Once your account is verified you will be able to start issuing certificates to your heart's content!?>
 
 <?=$link?>
-
-<?=_Best regards?>
-
-<?=_SomeCA.org Support?>
diff --git a/src/org/cacert/gigi/output/template/MailFooter.templ b/src/org/cacert/gigi/output/template/MailFooter.templ
new file mode 100644 (file)
index 0000000..b92e971
--- /dev/null
@@ -0,0 +1,13 @@
+
+<?=_Kind regards?>,
+<?=_SomeCA.org?>
+
+--
+<?=_This message has automatically been sent by the system.?>
+
+<?=_All emails originating from this domain use S/MIME protection through digital signatures and optional encryption.?>\
+<?=_Please report any unsigned emails, claiming to have originated from this service, to our support (please sign your email if available), by forwarding them including full email headers.?>
+
+<?=_Our support AND all personnel working on our behalf will NEVER ask you to reveal or provide your account credentials (i.e. passwords); although be aware that you might be asked to prove your identity (e.g. by signing your email) in order for support tickets regarding your account to be carried out.?>
+
+<?=_If you are unsure regarding communication you receive via this service, feel free to contact our support.?>
index 45f8594a594bdc762f5c157b6578aa7e6836bb7b..d1647a8bbe26cee675fb63f88ddcf6c3ee236674 100644 (file)
@@ -14,6 +14,8 @@ import org.cacert.gigi.localisation.Language;
 
 public class MailTemplate extends Template {
 
 
 public class MailTemplate extends Template {
 
+    private static final Template FOOTER = new Template(MailTemplate.class.getResource("MailFooter.templ"));
+
     public static final String SUBJECT_TAG = "[SomeCA] ";
 
     private TemplateBlock subjectBlock;
     public static final String SUBJECT_TAG = "[SomeCA] ";
 
     private TemplateBlock subjectBlock;
@@ -63,6 +65,7 @@ public class MailTemplate extends Template {
         vars.put(Outputable.OUT_KEY_PLAIN, true);
 
         String body = runTemplate(this, l, vars);
         vars.put(Outputable.OUT_KEY_PLAIN, true);
 
         String body = runTemplate(this, l, vars);
+        body += runTemplate(FOOTER, l, vars);
         String subject = runTemplate(subjectBlock, l, vars);
 
         SendMail.getInstance().sendMail(to, SUBJECT_TAG + subject, body, null, null, null, null, false);
         String subject = runTemplate(subjectBlock, l, vars);
 
         SendMail.getInstance().sendMail(to, SUBJECT_TAG + subject, body, null, null, null, null, false);
index dd27407149bec61bbedf0948a579cd3b194fac6a..6663a5b8afd6adb2850acc952a89a0391183d3f2 100644 (file)
@@ -7,6 +7,3 @@ Subject: <?=$subject?>
 <?=$link?>
 
 <?=_This process will expire in ${hour_max} hours.?>
 <?=$link?>
 
 <?=_This process will expire in ${hour_max} hours.?>
-
-<?=_Best regards?>
-<?=_SomeCA.org Support?>
index 646192adf33b14ac05acdfde7c96d4d79d44575b..c557c15d9e2093907a1362dc8d4efca73422fbd9 100644 (file)
@@ -20,5 +20,3 @@ Subject: <?=_Verification entered?>
 <? if($gotGreaterAll) { ?>\
 <?=_You can now apply for RA Agent status or code signing ability.?>
 <? } ?>\
 <? if($gotGreaterAll) { ?>\
 <?=_You can now apply for RA Agent status or code signing ability.?>
 <? } ?>\
-
-<?=_RA DB?>
index 288f541e71cf66b7dbb48c89d3d7253a1b19b039..fb610dc2bd2d9be56dc4bb38aaf2b72f2cc4fe19 100644 (file)
@@ -1,5 +1,6 @@
 package org.cacert.gigi.template;
 
 package org.cacert.gigi.template;
 
+import static org.hamcrest.CoreMatchers.*;
 import static org.junit.Assert.*;
 
 import java.io.IOException;
 import static org.junit.Assert.*;
 
 import java.io.IOException;
@@ -30,7 +31,7 @@ public class TestTemplateMail extends BusinessTest {
         testExecuteMail(vars, "Subject: subj\n\n<?=$var?>l");
         TestMail tm = getMailReceiver().receive();
         assertEquals(MailTemplate.SUBJECT_TAG + "subj", tm.getSubject());
         testExecuteMail(vars, "Subject: subj\n\n<?=$var?>l");
         TestMail tm = getMailReceiver().receive();
         assertEquals(MailTemplate.SUBJECT_TAG + "subj", tm.getSubject());
-        assertEquals("vall", tm.getMessage());
+        assertThat(tm.getMessage(), startsWith("vall"));
     }
 
     @Test
     }
 
     @Test
@@ -40,7 +41,7 @@ public class TestTemplateMail extends BusinessTest {
         testExecuteMail(vars, "Subject: a<?=$var?>b\n\n<?=$var2?>l");
         TestMail tm = getMailReceiver().receive();
         assertEquals(MailTemplate.SUBJECT_TAG + "aval\">b", tm.getSubject());
         testExecuteMail(vars, "Subject: a<?=$var?>b\n\n<?=$var2?>l");
         TestMail tm = getMailReceiver().receive();
         assertEquals(MailTemplate.SUBJECT_TAG + "aval\">b", tm.getSubject());
-        assertEquals("sl\">l", tm.getMessage());
+        assertThat(tm.getMessage(), startsWith("sl\">l"));
 
     }
 
 
     }
 
@@ -49,7 +50,7 @@ public class TestTemplateMail extends BusinessTest {
         testExecuteMail(vars, "Subject: a<?=_a<?>b\n\nc<?=_b\"?>l");
         TestMail tm = getMailReceiver().receive();
         assertEquals(MailTemplate.SUBJECT_TAG + "aa<b", tm.getSubject());
         testExecuteMail(vars, "Subject: a<?=_a<?>b\n\nc<?=_b\"?>l");
         TestMail tm = getMailReceiver().receive();
         assertEquals(MailTemplate.SUBJECT_TAG + "aa<b", tm.getSubject());
-        assertEquals("cb\"l", tm.getMessage());
+        assertThat(tm.getMessage(), startsWith("cb\"l"));
 
     }
 }
 
     }
 }