Hi,
I tried with your code but I have so many issues. this is what I did.
(1)Copied custom-action.jar in /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/lib location.
(2)changed the review_processdefinition.xml as
var mail = actions.create("mail2");
mail.parameters.to = bpm_assignee.properties.email;
mail.parameters.subject = "Review and Approval of Document";
mail.parameters.from = initiator.properties.email;
mail.parameters.text = "Hi <b> if you see this it is very bold</b> ";
mail.parameters.node=document;
mail.execute(bpm_package);
only these 2 changes. When I restart the server I am getting error and my server is not starting .Log says as below.
11:04:38,939 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
java.lang.RuntimeException: java.net.BindException: Address already in use
at org.subethamail.smtp.server.SMTPServer.start(SMTPServer.java:198)
at org.alfresco.email.server.impl.subetha.SubethaEmailServer.startup(SubethaEmailServer.java:60)
at org.alfresco.email.server.EmailServer.onBootstrap(EmailServer.java:230)
at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:294)
….
Caused by: java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at org.subethamail.smtp.server.SMTPServer.createServerSocket(SMTPServer.java:304)
at org.subethamail.smtp.server.SMTPServer.start(SMTPServer.java:194)
… 42 more
Also In 2nd way I copied that jar file and put custom-action-context.xml inside /opt/Alfresco/tomcat/shared/classes/alfresco/extension Still the same problem.
I created a class CustomMailActionExecuter.java with your code but there are so many errors as below
(a) import org.alfresco.repo.action.executer.TestModeable; is not there where I will find this class?
(b) inside executeImpl() MimeMessagePreparator mailPreparer = new MimeMessagePreparator(ruleAction, actionedUponNodeRef) shows the error the constructor Object() not defined.
Can you help pls?
Thanks