Пример #1
0
  public static Invite invite(Calendar calendar, Map<String, String> emails) {
    Invite invite = new Invite();
    invite.setMessage(factory.getStrategy().getStringValue());
    invite.setSubject(factory.getStrategy().getStringValue());
    invite.setShareId(calendar.getId());
    invite.setShareClassName(Calendar.class.getName());
    invite.setInviter(calendar.getMember().getMember());
    invite.setDirectLink("http://reminded.me");
    invite.setNotificationType(NotificationTypeEnum.EMAIL.ordinal());

    invite.setEmailAddresses(emails);

    return invite;
  }
Пример #2
0
  public static Invite buildInvite(boolean newInvite, String shareId, String className) {
    Invite invite = new Invite();
    invite.setMessage(factory.getStrategy().getStringValue());
    invite.setSubject(factory.getStrategy().getStringValue());
    invite.setShareId(shareId);
    invite.setShareClassName(className);
    //		invite.setShares(shares);

    invite.setDirectLink("http://reminded.me");
    invite.setNotificationType(NotificationTypeEnum.EMAIL.ordinal());

    int emailAddresses = new Random().nextInt(10) + 1;
    Map<String, String> emails = new HashMap<String, String>();
    for (int i = 0; i < emailAddresses; i++) {
      if (i % 2 == 0)
        emails.put(factory.getStrategy().getStringValue(), factory.getStrategy().getStringValue());
      else emails.put(factory.getStrategy().getStringValue(), null);
    }
    invite.setEmailAddresses(emails);

    newObjectCheck(invite, newInvite);

    return invite;
  }