Foros de discusión

Workflow email notification from no-reply@liferay.com

thumbnail
Gaurav Joshi, modificado hace 8 años.

Workflow email notification from no-reply@liferay.com

New Member Mensajes: 8 Fecha de incorporación: 14/04/14 Mensajes recientes
Hi
I want to change notification received from "no-reply@liferay.com" to my domain email.
The from address for email notification on "denied" and "granted" is ok but on "added", "reviewed" and "updated" it is giving from address as "no-reply@liferay.com".
How to change this behavior?
thumbnail
Vishal Kumar, modificado hace 8 años.

RE: Workflow email notification from no-reply@liferay.com

Regular Member Mensajes: 198 Fecha de incorporación: 12/12/12 Mensajes recientes
May This help You.

// You can specify the sender in the workflow context (default sender: "'Liferay Portal Workflow Notifications [no-reply@liferay.com]'")

HashMap<String, Object> workflowContext = new HashMap<String, Object>();

workflowContext.put(
WorkflowConstants.CONTEXT_NOTIFICATION_SENDER_ADDRESS,
"no-reply@yourdomain.com");
workflowContext.put(
WorkflowConstants.CONTEXT_NOTIFICATION_SENDER_NAME,
"Automated Notification Mailer");

serviceContext.setAttribute("workflowContext", workflowContext);

see below link also
http://www.liferay.com/de/community/wiki/-/wiki/Main/Workflow+Definition#section-Workflow+Definition-Task+-+Action+%28Notifications%29

It is answer of your question?

Regards,
Vishal
thumbnail
André Luís Ribeiro Didier, modificado hace 7 años.

RE: Workflow email notification from no-reply@liferay.com

New Member Mensajes: 5 Fecha de incorporación: 4/05/16 Mensajes recientes
Vishal Kumar:
May This help You.

// You can specify the sender in the workflow context (default sender: "'Liferay Portal Workflow Notifications [no-reply@liferay.com]'")

HashMap<String, Object> workflowContext = new HashMap<String, Object>();

workflowContext.put(
WorkflowConstants.CONTEXT_NOTIFICATION_SENDER_ADDRESS,
"no-reply@yourdomain.com");
workflowContext.put(
WorkflowConstants.CONTEXT_NOTIFICATION_SENDER_NAME,
"Automated Notification Mailer");

serviceContext.setAttribute("workflowContext", workflowContext);

see below link also
http://www.liferay.com/de/community/wiki/-/wiki/Main/Workflow+Definition#section-Workflow+Definition-Task+-+Action+%28Notifications%29

It is answer of your question?

Regards,
Vishal


I did as shown here. The sender name is ok, but the e-mail is still the one set in the portal instance (Control Panel / Configuration / Mail notification / Sender). Does the portal configuration override the workflowContext property?
Chris Taylor, modificado hace 6 años.

RE: Workflow email notification from no-reply@liferay.com

New Member Mensajes: 2 Fecha de incorporación: 5/11/15 Mensajes recientes
I am curious where you placed the above code? Was this in a Groovy script in your workflow definition XML, or was this Java code in the WorkflowHandler component? Or someplace else?
thumbnail
André Luís Ribeiro Didier, modificado hace 6 años.

RE: Workflow email notification from no-reply@liferay.com

New Member Mensajes: 5 Fecha de incorporación: 4/05/16 Mensajes recientes
Chris Taylor:
I am curious where you placed the above code? Was this in a Groovy script in your workflow definition XML, or was this Java code in the WorkflowHandler component? Or someplace else?

As a Groovy script in the workflow definition XML.
thumbnail
David H Nebinger, modificado hace 8 años.

RE: Workflow email notification from no-reply@liferay.com

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
That's the default value assigned in kaleo-web/WEB-INF/classes/META-INF/kaleo-spring.xml:

<bean class="com.liferay.portal.workflow.kaleo.runtime.notification.EmailNotificationSender">
	<property name="fromAddress" value="no-reply@liferay.com" />
	<property name="fromName" value="Liferay Portal Workflow Notifications" />
</bean>


I would actually recommend opening a jira ticket to make this a property-based value. Why Liferay would think that it's okay to hard-code their own email address into any of the plugins is just beyond me.

Second, you could edit the kaleo-spring.xml file to use your own default. You'll have to restart the container but it will stick.

Or you could use Vishal's suggestion, but that's typically for a one-off sort of scenario. If your workflow designers forget to set the value, well then no-reply@liferay.com will be back to haunt you.
thumbnail
Juan Gonzalez, modificado hace 8 años.

RE: Workflow email notification from no-reply@liferay.com

Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Hi Gauray,

I remember achieving this some years ago thanks to a script in a workflow XML file. Investigate that approach.
Shailesh Walke, modificado hace 8 años.

RE: Workflow email notification from no-reply@liferay.com

New Member Mensaje: 1 Fecha de incorporación: 19/11/14 Mensajes recientes
Hi,
I am also facing same problem. Mails are not always coming from no-reply@liferay.com. Mails are coming from test@liferay.com on approval granted and denied which is configured in Content ->Configuration and content of mail is picked up from template; but all other times like content reviewed or content added its coming from no-reply@liferay.com and content of mail is picked up from worklow xml file. I am using liferay default workflow on Liferayray 6.2 EE version. Why it behave different for approval granted, denied and content added, reviewed ?
thumbnail
Aldo De Vleeschauwer, modificado hace 8 años.

RE: Workflow email notification from no-reply@liferay.com

Junior Member Mensajes: 35 Fecha de incorporación: 9/03/11 Mensajes recientes
This works on LR 6.1: add following code in the Workflow xml definition, in an action before the notification.


			...
			<action>
				<name>setNotificationStuff</name>
				<script>
<![CDATA[
// Set mail stuff here in Javascript
workflowContext.put(Packages.com.liferay.portal.kernel.workflow.WorkflowConstants.CONTEXT_NOTIFICATION_SENDER_ADDRESS,­"no-reply@acme.be");
workflowContext.put(Packages.com.liferay.portal.kernel.workflow.WorkflowConstants.CONTEXT_NOTIFICATION_S­ENDER_NAME,"Acme Automated Notification");
]]>
				</script>
				<script-language>javascript</script-language>
				<execution-type>onEntry</execution-type>
			</action>

			<notification>
				<name>Content Review Notification</name>
...</notification>