TextHolder(GCMProperties gcmProperties) { this.tokenBody = readTokenMailBody(); this.dynamicMailBody = readDynamicMailBody(); this.staticMailBody = readStaticMailBody(); this.templateIdMailBody = readTemplateIdMailBody(); this.pushNotificationBody = gcmProperties.getNotificationBody(); this.resetPassLandingTemplate = readResetPassLandingTemplateAsString(); this.appResetEmailTemplate = readAppResetEmailTemplateAsString(); this.appResetEmailConfirmationTemplate = readAppResetEmailConfirmationTemplateAsString(); this.registerEmailTemplate = readRegisterEmailTemplate(); } }
private static String buildServerUpEmailBody(String url, String email, String pass) { String sb = "Your Admin url is " + url + "<br>" + "Your Admin login email is <b>" + email + "</b><br>" + "Your Admin password is <b>" + pass + "</b>"; return FileLoaderUtil.readNewServerUpTemplateAsString().replace(Placeholders.DYNAMIC_SECTION, sb); }
public MailWrapper(MailProperties mailProperties, String productName) { String host = mailProperties.getProperty("mail.smtp.host"); if (host != null) { mailProperties.put("mail.smtp.ssl.trust", host); } if (host != null && (host.endsWith("sparkpostmail.com") || host.endsWith("amazonaws.com"))) { // Amazon AWS Simple Email Service uses an account (mail.from) distinct from the username, // which is just like SparkPost. client = new ThirdPartyMailClient(mailProperties, productName); } else { client = new GMailClient(mailProperties); } this.reportBody = FileLoaderUtil.readReportEmailTemplate(); this.productName = productName; }
public ResetPasswordHttpLogic(Holder holder) { super(holder, ""); this.userDao = holder.userDao; this.tokensPool = holder.tokensPool; String productName = holder.props.productName; this.emailSubj = "Password reset request for the " + productName + " app."; this.emailBody = FileLoaderUtil.readResetEmailTemplateAsString() .replace(Placeholders.PRODUCT_NAME, productName); this.newResetPage = holder.textHolder.appResetEmailTemplate .replace(Placeholders.PRODUCT_NAME, productName); this.mailWrapper = holder.mailWrapper; String host = holder.props.host; //using https for private servers as they have valid certificates. String protocol = host.endsWith(".blynk.cc") ? "https://" : "http://"; this.resetPassUrl = protocol + host + "/landing?token="; this.pageContent = holder.textHolder.resetPassLandingTemplate; this.blockingIOProcessor = holder.blockingIOProcessor; this.dbManager = holder.dbManager; this.fileManager = holder.fileManager; this.resetClickHost = holder.props.getRestoreHost(); }