<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Can I send task mails from designer</title><link>https://answers.axonivy.com/questions/1733/can-i-send-task-mails-from-designer</link><description>&lt;p&gt;I've created a custom task mail process similar to the one in the JsfWorkflowUi. 
&lt;a href="http://developer.axonivy.com/doc/latest/EngineGuideHtml/administration.html#administration-emailnotification-design"&gt;http://developer.axonivy.com/doc/latest/EngineGuideHtml/administration.html#administration-emailnotification-design&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately I'm not able to receive any task mail if I simulate a process that create a new task. But it works on a real engine...&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1733/can-i-send-task-mails-from-designer" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 01 Nov 2016 10:48:51 -0400</lastBuildDate><item><title>Answer by Tinh Nguyen</title><link>https://answers.axonivy.com/questions/1733/can-i-send-task-mails-from-designer/2153</link><description>&lt;p&gt;Hi Reguel,
Thanks for your solution. I tried to configure it in my local but seems I still miss something to make it run.
This is what I did:
 1. Create a class and copy above code
 2. Import JsfWorkflowUi
 3. Create a user with email and run the process has a script call to configure of this class.&lt;/p&gt;
&lt;p&gt;But I always get exception at this step : IProperty host = appManager.getSystemProperty("EMail.Server.Host");
Can you give me a hint?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tinh Nguyen</dc:creator><pubDate>Tue, 01 Nov 2016 10:48:51 -0400</pubDate><guid>https://answers.axonivy.com/questions/1733/can-i-send-task-mails-from-designer/2153</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1733/can-i-send-task-mails-from-designer/1734</link><description>&lt;p&gt;Today with Axon.ivy 6.1 and older it's not possible to send task mails from the designer. The main blockers are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the mail servlet (ch.ivyteam.ivy.webserver.internal.IvyMailServlet) which generates the content of the task mail is not bound at designer time. &lt;/li&gt;
&lt;li&gt;tasks mails require the system application 'System' and its process model 'IvyCommons'. But at design time only one application 'Designer' is available&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Other difficulties which can be fixed/configured:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the task mail sender job does not respect the designer mail preferences. therefore the system wide mail properties of the engine have to be modified e.g. in a utitlity process &lt;/li&gt;
&lt;li&gt;the project that provides the task notification mail content process must be registered with an utitily process api call&lt;/li&gt;
&lt;li&gt;the designer app does not send any task mails by default. however with a JsfWorkflowUi or similar a test user can override his mail settings and enable task mails for any new task.&lt;/li&gt;
&lt;li&gt;the designer test user must have a mail address configured&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;sample utility code to enable mail sending in the designer:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;package mailGenerator;

import ch.ivyteam.di.restricted.DiCore;
import ch.ivyteam.ivy.application.IApplication;
import ch.ivyteam.ivy.application.IApplicationConfigurationManager;
import ch.ivyteam.ivy.environment.Ivy;
import ch.ivyteam.ivy.security.IEMailNotificationSettings;
import ch.ivyteam.ivy.system.IProperty;
import ch.ivyteam.ivy.workflow.StandardProcessType;

/**
 * Enable task mails in the designer to be generated with the JsfWorkflowUi
 */
public class DesignerMailUtitily {

    public static void configure()
    {
        configureEngineMailProperties();
        enableDesignerApplicationMails();
        useMailProcessFromJsfWorkflowUi();
    }

    private static void useMailProcessFromJsfWorkflowUi() {
        Ivy.wf().setStandardProcessImplementationLibrary(
                StandardProcessType.MailNotificationNewTask, "JsfWorkflowUi");
    }

    private static void enableDesignerApplicationMails() {
        IApplication designerApp = Ivy.wf().getApplication();
        IEMailNotificationSettings mailSettings = designerApp.getDefaultEMailNotifcationSettings();
        mailSettings.setNotificationDisabled(false);
        mailSettings.setSendOnNewWorkTasks(true);
        designerApp.setDefaultEMailNotifcationSettings(mailSettings);
    }

    /**
     * configure the minimal engine properties so that i can work with 'smtp4dev' or similar
     */
    private static void configureEngineMailProperties() {
        IApplicationConfigurationManager appManager = DiCore.getGlobalInjector()
                .getInstance(IApplicationConfigurationManager.class);
        IProperty host = appManager.getSystemProperty("EMail.Server.Host");
        host.setValue("localhost");
    }
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Thu, 14 Apr 2016 11:10:30 -0400</pubDate><guid>https://answers.axonivy.com/questions/1733/can-i-send-task-mails-from-designer/1734</guid></item></channel></rss>