Examples of EmailService


Examples of com.camunda.fox.bean.EmailService

  @Override
  protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = super.createRegistry();

    EmailService emailService = mock(EmailService.class);
    AccountService accountService = mock(AccountService.class);

    registry.bind("emailService", emailService);
    registry.bind("accountService", accountService);
View Full Code Here

Examples of com.example.prototypes.service.EmailService

    addressType.setActive(true);
    addressType.setDefaultDef(true);
    addressType.setName("Nowy");
    repository.save(addressType);
    // EmailAddressType addressType = repository.find(1L);
    EmailService service = context.getBean(EmailService.class);
    service.doIt();

    CheckingAccountService bean = context.getBean(CheckingAccountService.class);
    for (int i = 0; i < 10; i++) {
      bean.simpleSend();
    }
View Full Code Here

Examples of org.dspace.services.EmailService

    public void testGetSession()
            throws MessagingException
    {
        System.out.println("getSession");
        Session session;
        EmailService instance = getService(EmailServiceImpl.class);

        // Try to get a Session
        session = instance.getSession();
        assertNotNull(" getSession returned null", session);
    }
View Full Code Here

Examples of org.jivesoftware.util.EmailService

            }

            builder.append("<br/>");
            builder.append("<table>").append(transcript).append("</table>");

            EmailService emailService = EmailService.getInstance();
            emailService.sendMessage(null, to, null, from, subject, null, builder.toString());
        }
    }
View Full Code Here

Examples of org.jivesoftware.util.EmailService

            }

            builder.append("<br/>");
            builder.append("<table>").append(transcript).append("</table>");

            EmailService emailService = EmailService.getInstance();
            emailService.sendMessage(null, to, from, fromEmail, subject, null, builder.toString());
        }
    }
View Full Code Here

Examples of org.jivesoftware.util.EmailService

        if (ModelUtil.hasLength(sessionID)) {
            ChatTranscriptManager.sendTranscriptByMail(sessionID, to);
        }
        else {
            EmailService emailService = EmailService.getInstance();
            if (!useHTML) {
                emailService.sendMessage(null, to, null, from, subject, body, null);
            }
            else {
                emailService.sendMessage(null, to, null, from, subject, null, body);
            }
        }
        workgroup.send(reply);
    }
View Full Code Here

Examples of org.jivesoftware.util.EmailService

    }

    public void chatSupportFinished(Workgroup workgroup, String sessionID) {
        Log.debug("Chat Support Finished, sending transcripts");

        final EmailService emailService = EmailService.getInstance();

        String property = JiveGlobals.getProperty("mail.configured");
        if (!ModelUtil.hasLength(property)) {
            Log.debug("Mail settings are not configured, transcripts will not be sent.");
            return;
        }

        final ChatSession chatSession = ChatTranscriptManager.getChatSession(sessionID);
        if (chatSession == null || chatSession.getFirstSession() == null) {
            return;
        }

        final StringBuilder builder = new StringBuilder();

        SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyy hh:mm a");

        // Get duration of conversation
        Date date = new Date(chatSession.getFirstSession().getStartTime());
        int duration = getChatDuration(date, chatSession);

        TreeMap<String, List<String>> map = new TreeMap<String, List<String>>(chatSession.getMetadata());

        String body = JiveGlobals.getProperty("chat.transcript.body");

        if (ModelUtil.hasLength(body)) {
            builder.append(body).append("\n\n");
        }

        builder.append("formname=chat transcript\n");
        extractAndDisplay(builder, "question", map);
        display(builder, "fullname", chatSession.getCustomerName());
        extractAndDisplay(builder, "email", map);
        extractAndDisplay(builder, "Location", map);
        extractAndDisplay(builder, "userID", map);
        extractAndDisplay(builder, "username", map);
        extractAndDisplay(builder, "workgroup", map);
        display(builder, "chatduration", String.valueOf(duration));
        display(builder, "chatdate", formatter.format(date));
        if (chatSession.getFirstSession() != null && chatSession.getFirstSession().getAgentJID() != null) {
            try {
                display(builder, "agent", new JID(chatSession.getFirstSession().getAgentJID()).toBareJID());
            }
            catch (Exception e) {
                Log.debug("Could not display agent in transcript.", e);
            }
        }
        for (Iterator<Map.Entry<String, List<String>>> iterator = map.entrySet().iterator(); iterator.hasNext();) {
            Map.Entry<String, List<String>> entry = iterator.next();
            display(builder, entry.getKey(), getListItem(entry.getValue()));
        }
        builder.append("ctranscript=\n");
        builder.append(ChatTranscriptManager.getTextTranscriptFromSessionID(sessionID));

        String subject = JiveGlobals.getProperty("chat.transcript.subject");
        String from = JiveGlobals.getProperty("chat.transcript.from");
        String to = JiveGlobals.getProperty("chat.transcript.to");

        if (!ModelUtil.hasLength(subject) || !ModelUtil.hasLength(from)) {
            Log.debug("Transcript settings (chat.transcript.subject, chat.transcript.from) are not configured, " +
                    "transcripts will not be sent.");
            return;
        }

        if (ModelUtil.hasLength(to)) {
            emailService.sendMessage("Chat Transcript", to, "Chat Transcript", from, subject, builder.toString(), null);
            Log.debug("Transcript sent to " + to);
        }

        // NOTE: Do not sent to the customer. They will receive a prompt for a seperate chat transcript
        // that does not contain agent information.

        // Send to Agents
        UserManager um = UserManager.getInstance();
        for (Iterator<AgentChatSession> iterator = chatSession.getAgents(); iterator.hasNext();) {
            AgentChatSession agentSession = iterator.next();
            try {
                User user = um.getUser(new JID(agentSession.getAgentJID()).getNode());
                emailService.sendMessage("Chat Transcript", user.getEmail(), "Chat Transcript", from, subject, builder.toString(), null);
                Log.debug("Transcript sent to agent " + agentSession.getAgentJID());
            }
            catch (UserNotFoundException e) {
                Log.error("Email Transcript Not Sent:" +
                        "Could not load agent user object for jid " + agentSession.getAgentJID());
View Full Code Here

Examples of org.jivesoftware.util.EmailService

       
        private void sendAlertEmail(User user) {
            String subject = "User Registration";
            String body = " A new user with the username '" + user.getUsername() + "' just registered.";
           
            EmailService emailService = EmailService.getInstance();
            for (String toAddress : emailContacts) {
               try {
                   emailService.sendMessage(null, toAddress, "Openfire", "no_reply@" + serverName,
                           subject, body, null);
               }
               catch (Exception e) {
                   Log.error(e.getMessage(), e);
               }
View Full Code Here

Examples of org.jivesoftware.util.EmailService

            throw exception;
        }
    }

    private void sendNotifications(Packet packet, String packetSender) {
        EmailService emailService = EmailService.getInstance();
        String body;
        if (fromEmail == null) {
            return;
        }
        for (String toEmail : emailNotifyList) {
            body = StringUtils.replace(emailBody, "{packet}", packet.toXML());
            body = StringUtils.replace(body, "{sender}", packetSender);
            emailService.sendMessage(null, toEmail, fromName, fromEmail, emailSubject, body, null);
        }
    }
View Full Code Here

Examples of org.jnode.mail.service.EMailService

    queue = new LinkedList<>();
  }

  @Override
  public void start() {
    service = new EMailService();
    service.setFromAddr(properties.getProperty(CONFIG_FROM,
        "root@localhost"));
    service.setHost(properties.getProperty(CONFIG_HOST, "127.0.0.1"));
    service.setPort(properties.getProperty(CONFIG_PORT, "25"));
    service.setUsername(properties.getProperty(CONFIG_USER));
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.