As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
ActionService actionService = getServiceRegistry().getActionService(); Action mailAction = actionService.createAction(MailActionExecuter.NAME); mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, ExternalReviewNotification.SUBJECT); mailAction.setParameterValue(MailActionExecuter.PARAM_TO, recipient); mailAction.setParameterValue(MailActionExecuter.PARAM_FROM, ExternalReviewNotification.FROM_ADDRESS); mailAction.setParameterValue(MailActionExecuter.PARAM_TEXT, sb.toString()); actionService.executeAction(mailAction, null);
ActionService actionService = serviceRegistry.getActionService(); Action mailAction = actionService.createAction(MailActionExecuter.NAME); mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, subject); mailAction.setParameterValue(MailActionExecuter.PARAM_TO, to); mailAction.setParameterValue(MailActionExecuter.PARAM_FROM, from); mailAction.setParameterValue(MailActionExecuter.PARAM_TEXT, body); // Define Model String templatePATH = "PATH:\"/app:company_home/app:dictionary/app:email_templates/cm:workflownotification/cm:wf-custom-remind.ftl\""; ResultSet resultSet = serviceRegistry.getSearchService().query(new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore"), SearchService.LANGUAGE_LUCENE, templatePATH); if (resultSet.length()==0){ logger.error("Template "+ templatePATH+" not found."); return; } NodeRef template = resultSet.getNodeRef(0); mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE, template); // Define parameters for the model (set fields in the ftl like : args.workflowTitle) Map<String, Serializable> templateArgs = new HashMap<String, Serializable>(); templateArgs.put("workflowTitle","a"); templateArgs.put("workflowPooled", false); templateArgs.put("workflowPriority", 1); templateArgs.put("workflowDescription", "d"); templateArgs.put("workflowId",1); Map<String, Serializable> templateModel = new HashMap<String, Serializable>(); templateModel.put("args",(Serializable)templateArgs); mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL,(Serializable)templateModel); actionService.executeAction(mailAction, null);