Examples of EmailTemplate


Examples of com.gcrm.domain.EmailTemplate

        if (reminderOptionEmailID != null) {
            reminderOptionEmail = reminderOptionService.getEntityById(
                    ReminderOption.class, reminderOptionEmailID);
        }
        call.setReminder_option_email(reminderOptionEmail);
        EmailTemplate reminderTemplate = null;
        if (reminderTemplateID != null) {
            reminderTemplate = emailTemplateService.getEntityById(
                    EmailTemplate.class, reminderTemplateID);
        }
        call.setReminder_template(reminderTemplate);
View Full Code Here

Examples of com.gcrm.domain.EmailTemplate

        StringBuilder jsonBuilder = new StringBuilder("");
        jsonBuilder
                .append(getJsonHeader(totalRecords, searchCondition, isList));

        while (emailTemplates.hasNext()) {
            EmailTemplate instance = emailTemplates.next();
            int id = instance.getId();
            String name = CommonUtil.fromNullToEmpty(instance.getName());
            String type = CommonUtil.fromNullToEmpty(instance.getType());
            // Get type label
            String typeLabel = "";
            if ("meetingInvite".equals(type)) {
                typeLabel = getText("emailTemplate.meetingInvite.label");
            } else if ("meetingRemind".equals(type)) {
                typeLabel = getText("emailTemplate.meetingRemind.label");
            } else if ("callInvite".equals(type)) {
                typeLabel = getText("emailTemplate.callInvite.label");
            } else if ("callRemind".equals(type)) {
                typeLabel = getText("emailTemplate.callRemind.label");
            } else if ("campaignInvite".equals(type)) {
                typeLabel = getText("emailTemplate.campaignInvite.label");
            }
            String description = CommonUtil.fromNullToEmpty(instance
                    .getDescription());
            if (isList) {
                User createdBy = instance.getCreated_by();
                String createdByName = "";
                if (createdBy != null) {
                    createdByName = CommonUtil.fromNullToEmpty(createdBy
                            .getName());
                }
                User updatedBy = instance.getUpdated_by();
                String updatedByName = "";
                if (updatedBy != null) {
                    updatedByName = CommonUtil.fromNullToEmpty(updatedBy
                            .getName());
                }
                SimpleDateFormat dateFormat = new SimpleDateFormat(
                        Constant.DATE_TIME_FORMAT);
                Date createdOn = instance.getCreated_on();
                String createdOnName = "";
                if (createdOn != null) {
                    createdOnName = dateFormat.format(createdOn);
                }
                Date updatedOn = instance.getUpdated_on();
                String updatedOnName = "";
                if (updatedOn != null) {
                    updatedOnName = dateFormat.format(updatedOn);
                }
                jsonBuilder.append("{\"cell\":[\"").append(id).append("\",\"")
View Full Code Here

Examples of com.gcrm.domain.EmailTemplate

        UserUtil.permissionCheck("create_system");
        if (this.getSeleteIDs() != null) {
            String[] ids = seleteIDs.split(",");
            for (int i = 0; i < ids.length; i++) {
                String copyid = ids[i];
                EmailTemplate oriRecord = baseService.getEntityById(
                        EmailTemplate.class, Integer.valueOf(copyid));
                EmailTemplate targetRecord = oriRecord.clone();
                targetRecord.setId(null);
                this.baseService.makePersistent(targetRecord);
            }
        }
        return SUCCESS;
    }
View Full Code Here

Examples of com.gcrm.domain.EmailTemplate

                }
                targetEmails.append(email);
            }
        }
        if (targetEmails.length() > 0) {
            EmailTemplate remindEmailTemplte = call.getReminder_template();
            String targetEmail = targetEmails.toString();
            String[] to = targetEmail.split(",");
            String mailSubject = remindEmailTemplte.getSubject();
            String content = "";
            if (remindEmailTemplte.isText_only()) {
                content = remindEmailTemplte.getText_body();
            } else {
                content = remindEmailTemplte.getHtml_body();
            }
            // Replaces the variable in the body
            if (content != null) {
                content = content.replaceAll("\\$call.subject",
                        CommonUtil.fromNullToEmpty(call.getSubject()));
View Full Code Here

Examples of com.gcrm.domain.EmailTemplate

                targetEmails.append(email);
            }
        }

        if (targetEmails.length() > 0) {
            EmailTemplate remindEmailTemplte = meeting.getReminder_template();
            String targetEmail = targetEmails.toString();
            String[] to = targetEmail.split(",");
            String mailSubject = remindEmailTemplte.getSubject();

            String content = "";
            if (remindEmailTemplte.isText_only()) {
                content = remindEmailTemplte.getText_body();
            } else {
                content = remindEmailTemplte.getHtml_body();
            }
            // Replaces the variable in the body
            if (content != null) {
                content = content.replaceAll("\\$meeting.subject",
                        CommonUtil.fromNullToEmpty(meeting.getSubject()));
View Full Code Here

Examples of org.eurekastreams.server.support.email.EmailTemplate

            // create reponse message
            MimeMessage response = emailerFactory.createMessage();
            emailerFactory.setTo(response, user.getEmail());

            EmailTemplate template = errorMessageTemplates.get(actionName);
            if (template == null)
            {
                log.warn("Missing template for error response message for action {}.  Sending generic response.",
                        actionName);

                emailerFactory.setSubject(response, "Error processing received email");
                emailerFactory.setTextBody(response,
                        "There was an error processing your email.  " + cleanException.getMessage()
                                + "  Original message is attached.");
            }
            else
            {
                // prepare for template rendering
                Context velocityContext = new VelocityContext(velocityGlobalContext);
                velocityContext.put("action", actionName);
                velocityContext.put("params", actionSelection.getParams());
                velocityContext.put("user", user);
                velocityContext.put("exception", cleanException);
                velocityContext.put("originalException", inException);
                velocityContext.put("settings", systemSettingsDao.execute(null));

                // build the subject
                StringWriter writer = new StringWriter();
                velocityEngine.evaluate(velocityContext, writer, "EmailSubject-" + actionName,
                        template.getSubjectTemplate());
                emailerFactory.setSubject(response, writer.toString());

                // build the text body
                Template vt = velocityEngine.getTemplate(template.getTextBodyTemplateResourcePath());
                writer.getBuffer().setLength(0);
                vt.merge(velocityContext, writer);
                emailerFactory.setTextBody(response, writer.toString());

                // build the HTML body
                vt = velocityEngine.getTemplate(template.getHtmlBodyTemplateResourcePath());
                // HTML-escape all content inserted
                EventCartridge ec = new EventCartridge();
                ec.addEventHandler(new EscapeHtmlReference());
                ec.attachToContext(velocityContext);
                writer.getBuffer().setLength(0);
View Full Code Here

Examples of org.eurekastreams.server.support.email.EmailTemplate

     */
    public MessageReplierTest()
    {
        Map<String, EmailTemplate> map = new HashMap<String, EmailTemplate>(2);

        EmailTemplate template = new EmailTemplate();
        template.setHtmlBody(HTML_BODY_RESOURCE);
        template.setSubject(SUBJECT_TEMPLATE);
        template.setTextBody(TEXT_BODY_RESOURCE);
        map.put(ACTION_NAME, template);
        template = new EmailTemplate();
        template.setHtmlBody(HTML_BODY_RESOURCE + "NotUsed");
        template.setSubject(SUBJECT_TEMPLATE + "NotUsed");
        template.setTextBody(TEXT_BODY_RESOURCE + "NotUsed");
        map.put(ACTION_NAME + "NotUsed", template);

        errorMessageTemplates = Collections.unmodifiableMap(map);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.