| | |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Verification email"); |
| | | document.getElementsByTag("title").get(0).text("Verification code"); |
| | | Element user_chinese = document.getElementById("user_english"); |
| | | user_chinese.text("Hello " + nickName + ","); |
| | | Element content_english = document.getElementById("content_english"); |
| | |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | document.getElementsByTag("title").get(0).text("Courriel de vérification"); |
| | | document.getElementsByTag("title").get(0).text("Code de validation"); |
| | | Element user_french = document.getElementById("user_french"); |
| | | user_french.text("Bonjour " + nickName + ","); |
| | | Element content_french = document.getElementById("content_french"); |
| | | content_french.text(authCode); |
| | | } |
| | | EmailUtil.send(email, language == 1 ? "邮箱验证" : language == 2 ? "Verification mailbox" : "Courriel de vérification", document.html()); |
| | | EmailUtil.send(email, language == 1 ? "邮箱验证" : language == 2 ? "Verification code" : "Code de validation", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/mainbox_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/mainbox_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "邮箱验证" : language == 2 ? "Verification email" : "Courriel de vérification"); |
| | | tEmail.setName(language == 1 ? "邮箱验证" : language == 2 ? "Verification code" : "Code de validation"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(language,i)); |