Package com.sparc.knappsack.models

Examples of com.sparc.knappsack.models.EmailModel


        }
        return null;
    }

    public static void main(String[] args) {
        EmailModel emailModel = JsonUtil.unmarshall("{\"eventType\":\"USER_INVITE\",\"params\":{\"userId\":2,\"invitationIds\":[829,828]}}", EmailModel.class);
        convertIntegersToLongs(emailModel);
        Long fromUserId = (Long) emailModel.getParams().get("userId");
        List<Long> invitationIds = (List<Long>) emailModel.getParams().get("invitationIds");

//        SQSResignerModel model = new SQSResignerModel("myBucket", ApplicationType.IOS, "my/file/to/resign.ipa", "the/distribution/cert/dist.cert", "the/distribution/key/key.p12", "superSecretPassword", "the/distribution/profile/profile.mobileprovision", "https://mycallbackural.com/blahblah");
//
//        String json = JsonUtil.marshall(model);
//        System.out.println(json);
View Full Code Here


    @Override
    public boolean sendActivationEmail(Long userId) {
        boolean success = false;
        if (userId != null) {
            EmailModel model = new EmailModel();
            model.setEventType(EventType.USER_ACCOUNT_ACTIVATION);
            model.getParams().put("userId", userId);

            success = sendMessageToQueue(model);
        }
        return success;
    }
View Full Code Here

    @Override
    public boolean sendActivationSuccessEmail(Long userId) {
        boolean success = false;
        if (userId != null) {
            EmailModel model = new EmailModel();
            model.setEventType(EventType.USER_ACCOUNT_ACTIVATION_SUCCESS);
            model.getParams().put("userId", userId);

            success = sendMessageToQueue(model);
        }
        return success;
    }
View Full Code Here

    @Override
    public List<Long> sendInvitationsEmail(Long fromUserId, List<Long> invitationIds) {
        List<Long> invitationsSent = new ArrayList<Long>();
        if (!CollectionUtils.isEmpty(invitationIds)) {
            EmailModel model = new EmailModel();
            model.setEventType(EventType.USER_INVITE);
            model.getParams().put("userId", (fromUserId != null ? fromUserId : 0));
            model.getParams().put("invitationIds", invitationIds);

            if (sendMessageToQueue(model)) {
                invitationsSent.addAll(invitationIds);
            }
        }
View Full Code Here

    @Override
    public boolean sendPasswordResetEmail(Long userId, String password) {
        boolean success = false;
        if (userId != null && StringUtils.hasText(password)) {
            EmailModel model = new EmailModel();
            model.setEventType(EventType.USER_PASSWORD_RESET);
            model.getParams().put("userId", userId);
            model.getParams().put("password", password);

            success = sendMessageToQueue(model);
        }
        return success;
    }
View Full Code Here

    @Override
    public boolean sendApplicationPublishRequestEmail(Long applicationVersionId, UserModel userModel) {
        boolean success = false;
        if (applicationVersionId != null && userModel != null) {
            EmailModel model = new EmailModel();
            model.setEventType(EventType.APPLICATION_VERSION_ORGANIZATION_PUBLISH_REQUEST);
            model.getParams().put("applicationVersionId", applicationVersionId);
            model.getParams().put("userModel", userModel);

            success = sendMessageToQueue(model);
        }
        return success;
    }
View Full Code Here

    @Override
    public boolean sendDomainUserAccessConfirmationEmail(DomainUserRequestModel domainUserRequestModel) {
        boolean success = false;
        if (domainUserRequestModel != null && domainUserRequestModel.getUser() != null && domainUserRequestModel.getUser().getId() > 0) {
            EmailModel model = new EmailModel();
            model.setEventType(EventType.DOMAIN_USER_ACCESS_REQUEST_CONFIRMATION);
            model.getParams().put("domainUserRequestModel", domainUserRequestModel);

            success = sendMessageToQueue(model);
        }
        return success;
    }
View Full Code Here

    @Override
    public boolean sendOrganizationRegistrationEmail(Long organizationId, UserModel userModel) {
        boolean success = false;
        if (organizationId != null && userModel != null) {
            EmailModel model = new EmailModel();
            model.setEventType(EventType.ORGANIZATION_REGISTRATION);
            model.getParams().put("organizationId", organizationId);
            model.getParams().put("userModel", userModel);

            success = sendMessageToQueue(model);
        }
        return success;
    }
View Full Code Here

    public boolean sendApplicationVersionBecameVisibleEmail(Long applicationVersionId, List<Long> userIds) {
        boolean success = false;
        if (applicationVersionId != null && userIds != null) {
            List<EmailModel> emailModels = new ArrayList<EmailModel>();
            for (Long userId : userIds) {
                EmailModel model = new EmailModel();
                model.setEventType(EventType.APPLICATION_VERSION_STATE_CHANGED);
                model.getParams().put("applicationVersionId", applicationVersionId);
                model.getParams().put("userId", userId);

                emailModels.add(model);
            }

            int numSent = sendBatchMessagesToQueue(emailModels);
View Full Code Here

    public boolean sendBandwidthLimitNotification(Long organizationId, List<UserModel> users) {
        boolean success = false;
        if(organizationId != null && users != null) {
            List<EmailModel> emailModels = new ArrayList<EmailModel>();
            for (UserModel user : users) {
                EmailModel model = new EmailModel();
                model.setEventType(EventType.BANDWIDTH_LIMIT_REACHED);
                model.getParams().put("organizationId", organizationId);
                model.getParams().put("userModel", user);
                emailModels.add(model);
            }
            int numSent = sendBatchMessagesToQueue(emailModels);
            if (numSent == emailModels.size()) {
                success = true;
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.models.EmailModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.