Tabnine Logo
EmailNotification
Code IndexAdd Tabnine to your IDE (free)

How to use
EmailNotification
in
com.ning.billing.overdue

Best Java code snippets using com.ning.billing.overdue.EmailNotification (Showing top 3 results out of 315)

origin: com.ning.billing/killbill-overdue

  public String generateEmail(final Account account, final BillingState billingState,
                           final Account overdueable, final OverdueState nextOverdueState) throws IOException {
    final Map<String, Object> data = new HashMap<String, Object>();

    // TODO raw objects for now. We eventually should respect the account locale and support translations
    data.put("account", account);
    data.put("billingState", overdueEmailFormatterFactory.createBillingStateFormatter(billingState));
    data.put("overdueable", overdueable);
    data.put("nextOverdueState", nextOverdueState);

    // TODO single template for all languages for now
    return templateEngine.executeTemplate(nextOverdueState.getEnterStateEmailNotification().getTemplateName(), data);
  }
}
origin: com.ning.billing/killbill-overdue

Assert.assertEquals(secondNotification.getSubject(), "ToTo");
Assert.assertEquals(secondNotification.getTemplateName(), "Titi");
Assert.assertFalse(secondNotification.isHTML());
origin: com.ning.billing/killbill-overdue

private void sendEmailIfRequired(final BillingState billingState, final Account account,
                 final OverdueState nextOverdueState, final InternalTenantContext context) {
  // Note: we don't want to fail the full refresh call because sending the email failed.
  // That's the reason why we catch all exceptions here.
  // The alternative would be to: throw new OverdueApiException(e, ErrorCode.EMAIL_SENDING_FAILED);
  // If sending is not configured, skip
  if (nextOverdueState.getEnterStateEmailNotification() == null) {
    return;
  }
  final List<String> to = ImmutableList.<String>of(account.getEmail());
  // TODO - should we look at the account CC: list?
  final List<String> cc = ImmutableList.<String>of();
  final String subject = nextOverdueState.getEnterStateEmailNotification().getSubject();
  try {
    // Generate and send the email
    final String emailBody = overdueEmailGenerator.generateEmail(account, billingState, account, nextOverdueState);
    if (nextOverdueState.getEnterStateEmailNotification().isHTML()) {
      emailSender.sendHTMLEmail(to, cc, subject, emailBody);
    } else {
      emailSender.sendPlainTextEmail(to, cc, subject, emailBody);
    }
  } catch (IOException e) {
    log.warn(String.format("Unable to generate or send overdue notification email for account %s and overdueable %s", account.getId(), account.getId()), e);
  } catch (EmailApiException e) {
    log.warn(String.format("Unable to send overdue notification email for account %s and overdueable %s", account.getId(), account.getId()), e);
  } catch (MustacheException e) {
    log.warn(String.format("Unable to generate overdue notification email for account %s and overdueable %s", account.getId(), account.getId()), e);
  }
}
com.ning.billing.overdueEmailNotification

Most used methods

  • getSubject
  • getTemplateName
  • isHTML

Popular in Java

  • Reading from database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • getContentResolver (Context)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JTextField (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now