예제 #1
0
  private void emailAdmins(QuoteRequest quoteRequest) throws Exception {
    String adminEmailSubject = "Quote Request";

    StringBuffer stringBuffer = new StringBuffer();

    stringBuffer.append("\nUserName: "******"\nProject Info: \n");
    stringBuffer.append(quoteRequest.getProjectInfo());
    stringBuffer.append("\nUser Comments: \n");
    stringBuffer.append(quoteRequest.getUserComments());
    stringBuffer.append("\nBudget: \n");
    stringBuffer.append(quoteRequest.getBudget());
    stringBuffer.append("\nTime Frame: \n");
    stringBuffer.append(quoteRequest.getTimeFrame());
    stringBuffer.append("\nComments: \n");
    stringBuffer.append(quoteRequest.getComments());

    String adminEmailTextBody = stringBuffer.toString();

    BasicEmailInfo basicEmailInfo =
        (BasicEmailInfo)
            new StoreEmailInfo(this.storeFrontInterface, adminEmailSubject, adminEmailTextBody);

    EmailInfo emailInfo = new EmailInfo(basicEmailInfo);

    // send request to store admins if subscribed to handler name for review and response
    UserEmailEventHandler storeAdminUserEmailEventHandler =
        AdminUserEmailEventHandlerSingletons.getInstance(UserEmailEventNameData.QUOTEREQUEST);

    UserEmailEventHandler adminUserEmailEventHandler =
        StoreAdminUserEmailEventHandlerSingletons.getInstance(
            UserEmailEventNameData.QUOTEREQUEST, this.storeFrontInterface);

    storeAdminUserEmailEventHandler.receiveEmailInfo(
        UserEmailEventNameData.QUOTEREQUEST, emailInfo);
    adminUserEmailEventHandler.receiveEmailInfo(UserEmailEventNameData.QUOTEREQUEST, emailInfo);
  }