public void sendVerificationEmailViaWhydah(
      TokenServiceClient tokenServiceClient, String recipients, String verificationLink) {
    this.serviceClient = tokenServiceClient;

    String body = String.format(bodyTemplate, verificationLink);

    log.debug("Sending email to recipients={}, subject={}, body={}", recipients, subject, body);

    try {
      long timestamp = new Date().getTime() + 8 * 1000; // send mail after 8 seconds
      new CommandSendScheduledMail(
              URI.create(uasUrl),
              serviceClient.getMyAppTokenID(),
              serviceClient.getMyAppTokenXml(),
              Long.toString(timestamp),
              recipients,
              subject,
              body)
          .execute();
      log.info("Sent email to " + recipients);
    } catch (Exception e) {
      log.warn(
          "Failed to send mail due to missconfiguration? Reason {}", e.getCause().getMessage());
    }
  }
Example #2
0
 public boolean isTimeToReconcile(Account account) {
   return account.getLast_reconciliation() == null
       || (System.currentTimeMillis() - account.getLast_reconciliation().getTime())
           > 1000l
               * 60
               * Long.valueOf(
                   SysConfigManager.instance().getValue("reconciliationIntervalInMinutes", "60"));
 }
Example #3
0
 static {
   mailcheckDisableIntervalInHours =
       Long.valueOf(
           SysConfigManager.instance().getValue("mailcheckDisableIntervalInHours", "720"));
   dayMultiplier = 1000l * 60 * 60;
 }