{"id":235,"date":"2016-10-20T07:39:00","date_gmt":"2016-10-20T07:39:00","guid":{"rendered":""},"modified":"2020-01-17T07:35:42","modified_gmt":"2020-01-17T07:35:42","slug":"send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow","status":"publish","type":"post","link":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/","title":{"rendered":"Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left;\"><b>The Problem<\/b><\/p>\n<p><i>You want to send an email to the admin for approval or rejection and after approval, page should be activate and send an email to the author of activation and workflow should be complete but if rejected than send an email to the initiator of rejection and workflow should not be completed until the page approved using workflow<\/i>.<\/p>\n<p>In this post, I will show you all the required step and and configurations which we have to do.<\/p>\n<p>For send an email to the admin on the click of activate, Firstly you have to deny the permission of replication of that author. Now when you click on the activate button you will find a pop up like this:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG\"><\/a><\/div>\n<p>It means your <span style=\"color: purple;\"><i>request for activation<\/i><\/span> workflow has been launched.<\/p>\n<p><b><i><span style=\"color: purple;\">Note: It is applied till AEM 6.0 version above this version (AEM 6.1 &amp;&nbsp;AEM 6.2) Activate button will be disabled So In that case we can not activate from siteadmin for this, we have to go on that&nbsp;particular&nbsp;page for activate the page.<\/span><\/i><\/b><\/p>\n<p>Now if you will see in the admin inbox,you will find that request for activation workflow is in running condition.<\/p>\n<p>Now we have to change this model according to our requirements.<br \/>\nGo to the workflow by logging in to the admin interface:<br \/>\nhttp:\/\/localhost:4502\/libs\/cq\/workflow\/content\/console.html<\/p>\n<p>And search for <i><span style=\"color: purple;\">Request for Activation<\/span><\/i> model in model tab.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/3.bp.blogspot.com\/-F7ZMrlwCW04\/V-39xmCoUrI\/AAAAAAAABLw\/_AVp0a-Aiu48zvPV4vDRxNT6sPQ8kSoCgCLcB\/s1600\/workflow1.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img decoding=\"async\" border=\"0\" height=\"103\" src=\"https:\/\/3.bp.blogspot.com\/-F7ZMrlwCW04\/V-39xmCoUrI\/AAAAAAAABLw\/_AVp0a-Aiu48zvPV4vDRxNT6sPQ8kSoCgCLcB\/s400\/workflow1.PNG\" width=\"400\"><\/a><\/div>\n<p>Double click on this model and delete all steps and drop your <b><span style=\"color: purple;\">Dialog participant step<\/span><\/b> and double click on this step you will find a pop up like this:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-7G8L3t3cvxw\/V-3_tlDAv4I\/AAAAAAAABL4\/chDOTzts0qoH20MeNXYdxxjNt_Q7fxw9wCLcB\/s1600\/workflow2.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img fetchpriority=\"high\" decoding=\"async\" border=\"0\" height=\"213\" src=\"https:\/\/1.bp.blogspot.com\/-7G8L3t3cvxw\/V-3_tlDAv4I\/AAAAAAAABL4\/chDOTzts0qoH20MeNXYdxxjNt_Q7fxw9wCLcB\/s320\/workflow2.PNG\" width=\"320\"><\/a><\/div>\n<p>To Know about Dialog Participant Step <a href=\"http:\/\/lhotsetechnologies.com\/blog\/dialog-participant-step\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color: purple;\"><i>click here<\/i><\/span>:<\/a><\/p>\n<p>In this popup, there are three tabs <b>Common<\/b>, <b>User\/Group<\/b> and <b>Dialog<\/b>.<\/p>\n<p>In first tab, there are two widgets title and description. Here you can give title and description of your step.<br \/>\nIn second tab, there are two widgets User\/Group and Email.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/2.bp.blogspot.com\/-O18sraHOvjk\/V-4Nss2wd0I\/AAAAAAAABMk\/ELNiyrjMLnw9nuwaTYk5_BxNxX6p0DQIQCLcB\/s1600\/workflow5.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img decoding=\"async\" border=\"0\" height=\"218\" src=\"https:\/\/2.bp.blogspot.com\/-O18sraHOvjk\/V-4Nss2wd0I\/AAAAAAAABMk\/ELNiyrjMLnw9nuwaTYk5_BxNxX6p0DQIQCLcB\/s320\/workflow5.PNG\" width=\"320\"><\/a><\/div>\n<p>Select admin in user and tick on the Email if you want to send the mail to the admin inbox.<br \/>\n<i><span style=\"color: purple;\">Note:<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">If you want to send the mail to the gmail of admin than you have to give the gmail id to the admin from the useradmin console.<\/span><\/i><\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/4.bp.blogspot.com\/-SMjg41j5uf4\/V-4PHPxa84I\/AAAAAAAABMs\/YP8M2eQAlf86FRTEpwGa8ShGy-HDSOj5QCLcB\/s1600\/workflow6.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"220\" src=\"https:\/\/4.bp.blogspot.com\/-SMjg41j5uf4\/V-4PHPxa84I\/AAAAAAAABMs\/YP8M2eQAlf86FRTEpwGa8ShGy-HDSOj5QCLcB\/s320\/workflow6.PNG\" width=\"320\"><\/a><\/div>\n<p>In third tab you have to select the path of your dialog which you have created for the dialog participant step.<br \/>\nIn my case I select the path:<br \/>\n<span style=\"color: purple;\">\/etc\/workflow\/dialogs\/approval\/dialog<\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span>Now click on OK. your dialog participant step has been created.<\/p>\n<p>Now if we activate the page, an email will send to the admin inbox and gmailId. Admin will select this step and click on the complete tab than a dialog will open with the drop down. Admin will select approve or reject from the drop down than this value will be save into the workitem.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/2.bp.blogspot.com\/-Mc5z5Np2_XM\/V-47b_0cdAI\/AAAAAAAABNM\/A4bseS0Y74QCc0wnJmIl5P6ncKmjBG2AwCLcB\/s1600\/workflow8.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"218\" src=\"https:\/\/2.bp.blogspot.com\/-Mc5z5Np2_XM\/V-47b_0cdAI\/AAAAAAAABNM\/A4bseS0Y74QCc0wnJmIl5P6ncKmjBG2AwCLcB\/s320\/workflow8.PNG\" width=\"320\"><\/a><\/div>\n<p>Till now, workflow not complete this was only for our dialog participant step confirmation that it is working fine or not.<\/p>\n<p>So go back our workflow model and drop the process step below the dialog participant step.This step is used for fetch the value of dilaog input from the workitem and set this property on the workflow metedata.To do this we have to write an ECMA script with some code as given below:<\/p>\n<p><i><span style=\"color: purple;\">var name;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">var history = workflowSession.getHistory(workItem.getWorkflow());<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\">for (var index = history.size() &#8211; 1; index &gt;= 0; index&#8211;) {<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">&nbsp; var previous = history.get(index);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">&nbsp; &nbsp; var tempRejectApprove = previous.getWorkItem().getMetaDataMap().get(&#8216;name&#8217;);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">&nbsp; &nbsp; if ((tempRejectApprove != &#8221;)&amp;&amp;(tempRejectApprove != null)) {<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">&nbsp; &nbsp; &nbsp; &nbsp; name = tempRejectApprove;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">&nbsp; &nbsp; &nbsp; &nbsp; break;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">&nbsp; &nbsp; }<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">}<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">workItem.getWorkflowData().getMetaData().put(&#8216;name&#8217;, name);<\/span><\/i><\/p>\n<p>In my case I created a script named as relpaceDialogValue.ecma. Location of this file will be<br \/>\n<span style=\"color: purple;\">\/etc\/workflow\/scripts\/replaceDialogvalue.ecma<\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span>Now when we select from the process step drop down, this script will show and select it.<br \/>\nBecause of this script, your dialog value will be saved on workflow metadata.<\/p>\n<p>Now below this process step, we have to drop the OR Split process and select the 2 branches. In the first branch script, we have to write the script which is given below:<\/p>\n<p><span style=\"color: purple;\">function check() {<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; var match = &#8216;approve&#8217;;<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; if (workflowData.getMetaData().get(&#8216;name&#8217;) == match) {<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; &nbsp; &nbsp; return true;<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; } else {<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; &nbsp; &nbsp; return false;<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; }<\/span><br \/>\n<span style=\"color: purple;\">}&nbsp;<\/span><\/p>\n<p>In the Second Branch we have to write this code:<\/p>\n<p><span style=\"color: purple;\">function check() {<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; var match = &#8216;rejected&#8217;;<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; if (workflowData.getMetaData().get(&#8216;name&#8217;) == match) {<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; &nbsp; &nbsp; return true;<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; } else {<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; &nbsp; &nbsp; return false;<\/span><br \/>\n<span style=\"color: purple;\">&nbsp; &nbsp; }<\/span><br \/>\n<span style=\"color: purple;\">}<\/span><br \/>\n<b>If the branch 1 will return true then workflow move on left side. If Branch 1 return false or branch2 return true then workflow will move on right side.<\/b><\/p>\n<p><i><span style=\"color: purple;\"><b>Note:<\/b><\/span><\/i><br \/>\n<i><span style=\"color: purple;\">Before the OR Step I have to use Process step because we can not access the value of the dialog from workItem in to the OR Split process there is an error that &#8220;workitem is not defined&#8221; because OR Split process does not have workitem object so I have to use process Step.<\/span><\/i><\/p>\n<p><b><i>Step for left split:<\/i><\/b><\/p>\n<p>Now one more process step drop in to the left split.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-s1tHRO-GvWI\/WAcO4Q3odWI\/AAAAAAAABPw\/LBPBdbHb1qEpqlBtw8eY7k26bY7MdPQ5ACLcB\/s1600\/workflow9.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/1.bp.blogspot.com\/-s1tHRO-GvWI\/WAcO4Q3odWI\/AAAAAAAABPw\/LBPBdbHb1qEpqlBtw8eY7k26bY7MdPQ5ACLcB\/s1600\/workflow9.PNG\"><\/a><\/div>\n<p>&nbsp;Double click on this step and go to the process tab and select activate page from the drop down.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/2.bp.blogspot.com\/-dUMeOtGtt0M\/V-45xGHtLBI\/AAAAAAAABNA\/5srMOidLIeIDKcUzcO_H45Oeq3w9FbBlgCLcB\/s1600\/workflow7.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"215\" src=\"https:\/\/2.bp.blogspot.com\/-dUMeOtGtt0M\/V-45xGHtLBI\/AAAAAAAABNA\/5srMOidLIeIDKcUzcO_H45Oeq3w9FbBlgCLcB\/s320\/workflow7.PNG\" width=\"320\"><\/a><\/div>\n<p>This process step will activate the page after selection by the admin as approve from the inbox as select the drop down.<\/p>\n<p>Below this step drop one more process step for sending the mail to the initiator.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-TrYk4IutHsY\/WAcPOtx_IrI\/AAAAAAAABP0\/W6_cnAlkmIsLP9RsdeTXUJ43HFAj31VzACLcB\/s1600\/workflow10.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"67\" src=\"https:\/\/1.bp.blogspot.com\/-TrYk4IutHsY\/WAcPOtx_IrI\/AAAAAAAABP0\/W6_cnAlkmIsLP9RsdeTXUJ43HFAj31VzACLcB\/s320\/workflow10.PNG\" width=\"320\"><\/a><\/div>\n<p>&nbsp;Double click on this step and select the custom process step (custom step for approval) for sending the mail to the initiator.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/4.bp.blogspot.com\/-a5QXgJONOhQ\/WAcPw32h3fI\/AAAAAAAABP8\/xIi_6_l5WKIkWqNh0MIj_QGvOfWAR4IiQCLcB\/s1600\/workflow11.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"218\" src=\"https:\/\/4.bp.blogspot.com\/-a5QXgJONOhQ\/WAcPw32h3fI\/AAAAAAAABP8\/xIi_6_l5WKIkWqNh0MIj_QGvOfWAR4IiQCLcB\/s320\/workflow11.PNG\" width=\"320\"><\/a><\/div>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<p>&nbsp;<b>Code for this step is given below:<\/b><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\">package com.havells.services;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\">import java.util.List;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\">import javax.jcr.RepositoryException;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\">import org.slf4j.Logger;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.slf4j.LoggerFactory;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.apache.felix.scr.annotations.Component;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.apache.felix.scr.annotations.Service;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.apache.felix.scr.annotations.Properties;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.apache.felix.scr.annotations.Property;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.apache.felix.scr.annotations.Reference;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.apache.jackrabbit.api.security.user.Authorizable;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.apache.jackrabbit.api.security.user.UserManager;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.apache.sling.api.resource.ResourceResolver;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.apache.sling.commons.osgi.PropertiesUtil;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.osgi.framework.Constants;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\">import com.adobe.granite.workflow.WorkflowException;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import com.adobe.granite.workflow.WorkflowSession;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import com.adobe.granite.workflow.exec.HistoryItem;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import com.adobe.granite.workflow.exec.WorkItem;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import com.adobe.granite.workflow.exec.Workflow;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import com.adobe.granite.workflow.exec.WorkflowProcess;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import com.adobe.granite.workflow.metadata.MetaDataMap;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import com.day.cq.mailer.MessageGateway;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import com.day.cq.mailer.MessageGatewayService;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\">import org.apache.commons.mail.Email;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">import org.apache.commons.mail.SimpleEmail;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\">\/\/This is a component so it can provide or consume services<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">@Component<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">@Service<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">@Properties({<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>@Property(name = Constants.SERVICE_DESCRIPTION, value = &#8220;Test Email workflow process implementation.&#8221;),<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>@Property(name = Constants.SERVICE_VENDOR, value = &#8220;Adobe&#8221;),<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>@Property(name = &#8220;process.label&#8221;, value = &#8220;Custom Step for approval&#8221;) })<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">public class CustomStepForApproval implements WorkflowProcess {<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\"> <\/span>protected final Logger log = LoggerFactory.getLogger(this.getClass());<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\"> <\/span>@Reference<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\"> <\/span>private MessageGatewayService messageGatewayService;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\"> <\/span>public void execute(WorkItem workitem, WorkflowSession wfsession,<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>MetaDataMap metaDataMap) throws WorkflowException {<\/span><\/i><br \/>\n<span style=\"white-space: pre;\"><i><span style=\"color: purple;\">  <\/span><\/i><\/span><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>ResourceResolver resolver = wfsession.adaptTo(ResourceResolver.class);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>UserManager userManager = resolver.adaptTo(UserManager.class);<\/span><\/i><br \/>\n<span style=\"white-space: pre;\"><i><span style=\"color: purple;\">  <\/span><\/i><\/span><br \/>\n<span style=\"white-space: pre;\"><i><span style=\"color: purple;\">  <\/span><\/i><\/span><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>Workflow workflow = workitem.getWorkflow();<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>String payload = (String) workitem.getWorkflowData().getPayload();<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>String initiator = workitem.getWorkflow().getInitiator();<\/span><\/i><br \/>\n<span style=\"white-space: pre;\"><i><span style=\"color: purple;\">  <\/span><\/i><\/span><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>Authorizable authorizable = null;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>String userEmail = null;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>try {<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>authorizable = userManager.getAuthorizable(initiator);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>} catch (RepositoryException e1) {<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>\/\/ TODO Auto-generated catch block<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>e1.printStackTrace();<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>}<\/span><\/i><br \/>\n<i><span style=\"color: purple;\">&nbsp; &nbsp; &nbsp; &nbsp; try {<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span> userEmail = PropertiesUtil.toString(authorizable.getProperty(&#8220;profile\/email&#8221;), &#8220;&#8221;);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>} catch (RepositoryException e1) {<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>\/\/ TODO Auto-generated catch block<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>e1.printStackTrace();<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>}<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>String temp = null;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>List&lt;HistoryItem&gt; list = wfsession.getHistory(workflow);<\/span><\/i><br \/>\n<span style=\"white-space: pre;\"><i><span style=\"color: purple;\">  <\/span><\/i><\/span><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>for(int index = list.size()-1; index &gt;=1; index&#8211;){<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">    <\/span>HistoryItem previous = list.get(index);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">    <\/span>temp = (String) previous.getWorkItem().getMetaDataMap().get(&#8220;name&#8221;);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>}<\/span><\/i><br \/>\n<span style=\"white-space: pre;\"><i><span style=\"color: purple;\">   <\/span><\/i><\/span><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>try {<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>MessageGateway&lt;Email&gt; messageGateway;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>Email email = new SimpleEmail();<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>String emailToRecipients = userEmail;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>\/\/String emailCcRecipients = &#8220;abc@gmail.com&#8221;;<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>email.addTo(emailToRecipients);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>\/\/email.addCc(emailCcRecipients);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>email.setSubject(&#8220;AEM Custom Step&#8221;);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>email.setFrom(&#8220;gkgauravkumar445@gmail.com&#8221;);<\/span><\/i><br \/>\n<span style=\"white-space: pre;\"><i><span style=\"color: purple;\">   <\/span><\/i><\/span><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>if(temp .equals(&#8220;approve&#8221;)){<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">    <\/span>email.setMsg(&#8220;This message is to inform you that the CQ content has been approved and activated which Payload path is = &#8220;+ payload);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>}else{<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">    <\/span>email.setMsg(&#8220;This message is to inform you that the CQ content has been Rejected Please modify it which Payload path is = &#8220;+ payload);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>}<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>\/\/ Inject a MessageGateway Service and send the message<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>messageGateway = messageGatewayService.getGateway(Email.class);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>\/\/ Check the logs to see that messageGateway is not null<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>messageGateway.send((Email) email);<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>}<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>catch (Exception e) {<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">   <\/span>e.printStackTrace();<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\">  <\/span>}<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><span style=\"white-space: pre;\"> <\/span>}<\/span><\/i><br \/>\n<i><span style=\"color: purple;\"><br \/>\n<\/span><\/i><i><span style=\"color: purple;\">}<\/span><\/i><\/p>\n<p><b><i>Step for Right Split:<\/i><\/b><\/p>\n<p>In the right split, I will drop a process step for sending the mail of rejection to the initiator.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-pL0_3oMTw8I\/WAcTCPjNePI\/AAAAAAAABQI\/U3CIbqBANV0Gt-ITlRuK96ME8W9qf4fdACLcB\/s1600\/workflow12.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/1.bp.blogspot.com\/-pL0_3oMTw8I\/WAcTCPjNePI\/AAAAAAAABQI\/U3CIbqBANV0Gt-ITlRuK96ME8W9qf4fdACLcB\/s1600\/workflow12.PNG\"><\/a><\/div>\n<div style=\"clear: both; text-align: center;\"><span style=\"text-align: left;\">Double click on this step and select the custom process step (custom step for approval) for sending the mail to the initiator.<\/span><\/div>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/3.bp.blogspot.com\/-eHiEHe32hzE\/WAcTaT5z-oI\/AAAAAAAABQM\/xI8MCqxY-xgTdbyjnY1xANYXNu5NrxwkwCLcB\/s1600\/workflow13.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"225\" src=\"https:\/\/3.bp.blogspot.com\/-eHiEHe32hzE\/WAcTaT5z-oI\/AAAAAAAABQM\/xI8MCqxY-xgTdbyjnY1xANYXNu5NrxwkwCLcB\/s320\/workflow13.PNG\" width=\"320\"><\/a><\/div>\n<p><span style=\"color: purple;\">Now below this step drop <\/span><b style=\"color: purple;\"><span style=\"color: purple;\">Dynamic Participant Step<\/span><\/b><span style=\"color: purple;\">.<\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\">About Dynamic Participant Step, I discussed in my last blog<\/span><span style=\"color: purple;\"> <span style=\"color: purple;\"><a href=\"http:\/\/lhotsetechnologies.com\/blog\/dynamic-participant-step\/\" target=\"_blank\" rel=\"noopener noreferrer\">click here.<\/a><\/span><\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span><a href=\"https:\/\/4.bp.blogspot.com\/-jRSYu9W8u5s\/WAdJo5q9T3I\/AAAAAAAABQw\/3x_y3iEUzdYgLZOtEyNC7LQmAAgXmaSXwCLcB\/s1600\/workflow16.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img decoding=\"async\" border=\"0\" src=\"https:\/\/4.bp.blogspot.com\/-jRSYu9W8u5s\/WAdJo5q9T3I\/AAAAAAAABQw\/3x_y3iEUzdYgLZOtEyNC7LQmAAgXmaSXwCLcB\/s1600\/workflow16.PNG\"><\/a><span style=\"color: purple;\"><span style=\"background-color: white;\"><\/span><\/span><br \/>\n<span style=\"color: purple;\"><span style=\"color: purple;\"><span style=\"background-color: white;\"><br \/>\n<\/span><\/span><\/span><span style=\"color: purple;\">Double click on this step and select the custom dynamic participant step (workflow participant chooser) for assign to the initiator.&nbsp;<\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><br \/>\n<\/span><\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-OJy4y4i8Rtw\/WAdKhEF8gmI\/AAAAAAAABQ0\/fwO3lb09vZURgbymrIywPpJ2tua9sh1mwCLcB\/s1600\/workflow15.PNG\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"221\" src=\"https:\/\/1.bp.blogspot.com\/-OJy4y4i8Rtw\/WAdKhEF8gmI\/AAAAAAAABQ0\/fwO3lb09vZURgbymrIywPpJ2tua9sh1mwCLcB\/s320\/workflow15.PNG\" width=\"320\"><\/a><\/div>\n<p><span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\">Don&#8217;t forget to mark the email. Because of this, the mail will be send to the initiator inbox.<\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\">Now click OK. Now because of this step the mail will be send to the initiator inbox and from the inbox the initiator will click on complete tab.&nbsp;<\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\">Now Below this step we will drop <b><span style=\"color: purple;\">GoTo Step<\/span><\/b>. And select the Dialog Participant Step from the drop down for which the next will be execute as a Dialog Participant Step.<\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\">To know Goto Step<\/span><span style=\"color: purple;\"> <i><span style=\"color: purple;\"><a href=\"http:\/\/lhotsetechnologies.com\/blog\/goto-step\/\" target=\"_blank\" rel=\"noopener noreferrer\">Click here<\/a><\/span><\/i><\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><b>This process will be continue until the admin will not approve the page.<\/b><\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\">So the final model will be look like this:<\/span><br \/>\n<span style=\"color: purple;\"><br \/>\n<\/span><\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-_0Hig6gGi4k\/WAdWde8krHI\/AAAAAAAABRU\/lQRDDRKT4xA9eaDtHPVvVd0tj6L2jnRNACLcB\/s1600\/workflow19.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"400\" src=\"https:\/\/1.bp.blogspot.com\/-_0Hig6gGi4k\/WAdWde8krHI\/AAAAAAAABRU\/lQRDDRKT4xA9eaDtHPVvVd0tj6L2jnRNACLcB\/s640\/workflow19.PNG\" width=\"640\"><\/a><\/div>\n<p><span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><br \/>\n<\/span><span style=\"color: purple;\"><span style=\"color: purple;\"><b><i>Be Happy<\/i><\/b><\/span><\/span><span style=\"color: purple;\"><br \/>\n<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Problem You want to send an email to the admin for approval or rejection and after approval, page should [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,82,189,190,191,192,193,124],"tags":[],"class_list":["post-235","post","type-post","status-publish","format-standard","hentry","category-aem","category-cq5","category-custom-dynacmic-participant-step","category-custom-process-step","category-dialog-participant-step-in-aem","category-send-an-email-for-approval-or-rejection-to-the-admin-in-a-cq5-aem-in-aem","category-sending-mail-for-approval","category-workflow"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow - AEM Blog | Lhotse Technologies<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow - AEM Blog | Lhotse Technologies\" \/>\n<meta property=\"og:description\" content=\"The Problem You want to send an email to the admin for approval or rejection and after approval, page should [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/\" \/>\n<meta property=\"og:site_name\" content=\"AEM Blog | Lhotse Technologies\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-20T07:39:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-17T07:35:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG\" \/>\n<meta name=\"author\" content=\"Team Lhotse\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Team Lhotse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/\"},\"author\":{\"name\":\"Team Lhotse\",\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/#\/schema\/person\/fd7bee89b050d7c7195fc75b681b053d\"},\"headline\":\"Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow\",\"datePublished\":\"2016-10-20T07:39:00+00:00\",\"dateModified\":\"2020-01-17T07:35:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/\"},\"wordCount\":1597,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG\",\"articleSection\":[\"AEM\",\"CQ5\",\"Custom Dynacmic Participant Step\",\"Custom Process Step\",\"Dialog Participant Step in aem\",\"Send an Email for approval or rejection to the admin in a CQ5\/AEM in aem\",\"Sending mail for approval\",\"workflow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/\",\"url\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/\",\"name\":\"Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow - AEM Blog | Lhotse Technologies\",\"isPartOf\":{\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG\",\"datePublished\":\"2016-10-20T07:39:00+00:00\",\"dateModified\":\"2020-01-17T07:35:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#primaryimage\",\"url\":\"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG\",\"contentUrl\":\"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/lhotsetechnologies.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/#website\",\"url\":\"https:\/\/lhotsetechnologies.com\/blog\/\",\"name\":\"AEM Blog | Lhotse Technologies\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/lhotsetechnologies.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/#organization\",\"name\":\"AEM Blog | Lhotse Technologies\",\"url\":\"https:\/\/lhotsetechnologies.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/lhotsetechnologies.com\/blog\/wp-content\/uploads\/2019\/07\/lhotse-logo.png\",\"contentUrl\":\"https:\/\/lhotsetechnologies.com\/blog\/wp-content\/uploads\/2019\/07\/lhotse-logo.png\",\"width\":539,\"height\":172,\"caption\":\"AEM Blog | Lhotse Technologies\"},\"image\":{\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/#\/schema\/person\/fd7bee89b050d7c7195fc75b681b053d\",\"name\":\"Team Lhotse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lhotsetechnologies.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"Team Lhotse\"},\"url\":\"https:\/\/lhotsetechnologies.com\/blog\/author\/team-lhotse\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow - AEM Blog | Lhotse Technologies","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/","og_locale":"en_US","og_type":"article","og_title":"Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow - AEM Blog | Lhotse Technologies","og_description":"The Problem You want to send an email to the admin for approval or rejection and after approval, page should [&hellip;]","og_url":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/","og_site_name":"AEM Blog | Lhotse Technologies","article_published_time":"2016-10-20T07:39:00+00:00","article_modified_time":"2020-01-17T07:35:42+00:00","og_image":[{"url":"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG","type":"","width":"","height":""}],"author":"Team Lhotse","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Team Lhotse","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#article","isPartOf":{"@id":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/"},"author":{"name":"Team Lhotse","@id":"https:\/\/lhotsetechnologies.com\/blog\/#\/schema\/person\/fd7bee89b050d7c7195fc75b681b053d"},"headline":"Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow","datePublished":"2016-10-20T07:39:00+00:00","dateModified":"2020-01-17T07:35:42+00:00","mainEntityOfPage":{"@id":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/"},"wordCount":1597,"commentCount":0,"publisher":{"@id":"https:\/\/lhotsetechnologies.com\/blog\/#organization"},"image":{"@id":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#primaryimage"},"thumbnailUrl":"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG","articleSection":["AEM","CQ5","Custom Dynacmic Participant Step","Custom Process Step","Dialog Participant Step in aem","Send an Email for approval or rejection to the admin in a CQ5\/AEM in aem","Sending mail for approval","workflow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/","url":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/","name":"Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow - AEM Blog | Lhotse Technologies","isPartOf":{"@id":"https:\/\/lhotsetechnologies.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#primaryimage"},"image":{"@id":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#primaryimage"},"thumbnailUrl":"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG","datePublished":"2016-10-20T07:39:00+00:00","dateModified":"2020-01-17T07:35:42+00:00","breadcrumb":{"@id":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#primaryimage","url":"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG","contentUrl":"https:\/\/1.bp.blogspot.com\/-kcHRX7_w4k0\/WAch-jsJ1xI\/AAAAAAAABQg\/4ALKpaHex2ET-xOuMVGR6hG30mJPk1pYQCLcB\/s1600\/workflow14.PNG"},{"@type":"BreadcrumbList","@id":"https:\/\/lhotsetechnologies.com\/blog\/send-an-email-for-approval-to-the-admin-in-a-cq5-aem-page-publishing-workflow\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lhotsetechnologies.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Send an Email for approval to the admin in a CQ5\/AEM page publishing workflow"}]},{"@type":"WebSite","@id":"https:\/\/lhotsetechnologies.com\/blog\/#website","url":"https:\/\/lhotsetechnologies.com\/blog\/","name":"AEM Blog | Lhotse Technologies","description":"","publisher":{"@id":"https:\/\/lhotsetechnologies.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lhotsetechnologies.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/lhotsetechnologies.com\/blog\/#organization","name":"AEM Blog | Lhotse Technologies","url":"https:\/\/lhotsetechnologies.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lhotsetechnologies.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/lhotsetechnologies.com\/blog\/wp-content\/uploads\/2019\/07\/lhotse-logo.png","contentUrl":"https:\/\/lhotsetechnologies.com\/blog\/wp-content\/uploads\/2019\/07\/lhotse-logo.png","width":539,"height":172,"caption":"AEM Blog | Lhotse Technologies"},"image":{"@id":"https:\/\/lhotsetechnologies.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/lhotsetechnologies.com\/blog\/#\/schema\/person\/fd7bee89b050d7c7195fc75b681b053d","name":"Team Lhotse","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lhotsetechnologies.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Team Lhotse"},"url":"https:\/\/lhotsetechnologies.com\/blog\/author\/team-lhotse\/"}]}},"_links":{"self":[{"href":"https:\/\/lhotsetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lhotsetechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lhotsetechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lhotsetechnologies.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lhotsetechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=235"}],"version-history":[{"count":3,"href":"https:\/\/lhotsetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/235\/revisions"}],"predecessor-version":[{"id":556,"href":"https:\/\/lhotsetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/235\/revisions\/556"}],"wp:attachment":[{"href":"https:\/\/lhotsetechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lhotsetechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lhotsetechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}