Forums de discussion

Workflow email notification from no-reply@liferay.com

thumbnail
Gaurav Joshi, modifié il y a 8 années.

Workflow email notification from no-reply@liferay.com

New Member Publications: 8 Date d'inscription: 14/04/14 Publications récentes
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, modifié il y a 8 années.

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

Regular Member Publications: 198 Date d'inscription: 12/12/12 Publications récentes
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, modifié il y a 7 années.

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

New Member Publications: 5 Date d'inscription: 04/05/16 Publications récentes
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, modifié il y a 6 années.

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

New Member Publications: 2 Date d'inscription: 05/11/15 Publications récentes
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, modifié il y a 6 années.

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

New Member Publications: 5 Date d'inscription: 04/05/16 Publications récentes
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, modifié il y a 8 années.

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

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
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, modifié il y a 8 années.

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

Liferay Legend Publications: 3089 Date d'inscription: 28/10/08 Publications récentes
Hi Gauray,

I remember achieving this some years ago thanks to a script in a workflow XML file. Investigate that approach.
Shailesh Walke, modifié il y a 8 années.

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

New Member Envoyer: 1 Date d'inscription: 19/11/14 Publications récentes
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, modifié il y a 8 années.

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

Junior Member Publications: 35 Date d'inscription: 09/03/11 Publications récentes
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>