E-Mail Notifications and Request Parameters
Hi, I am trying to set up an e-mail notification which gets fired when an attribute of a user is changed. I would like an email to be sent to a specified user which uses an email template something like the following: <p>An attribute on the user [//Target/DisplayName] was changed by [//Requestor/DisplayName]</p> <p>[//RequestParameter/PropertyName] was changed to [//RequestParameter/Value]</p> I have set up the MPR, Email template, and Workflow, and when I change an attribute on the user, the e-mail gets sent. However, the RequestParameter values are blank; the email looks like this: An attribute on the user TESTUSER was changed by TESTUSER2 was changed to I have also tried to add a workflow function to store [//RequestParameter/PropertyName] in [//WorkflowData/PropertyName], and changed the email template accordingly. The results were the same as above. Anyone see what I'm doing wrong? Or is there another way to access the information I am looking for? Thanks, Mark
February 18th, 2010 7:00pm

Hi Mark,You can acheive by adding the following in the template, <p class="MsoNormal"><b>Request details:</b></p> <p class="MsoNormal"> <table style="width: 80%"> <tr class="HeadingStyle"> <td>Attribute</td> <td>Old Value</td> <td>New Value</td> </tr> [//RequestParameter/AllChangesAuthorizationTable] </table> </p> This should display the old and new values in email.Thanks,Sri
Free Windows Admin Tool Kit Click here and download it now
February 19th, 2010 9:20pm

Thanks again Sri, that worked great. I had also tried to use [//RequestParameter/AllChangesTable] as it is shown in the evaluatg function activity lookup, but it didn't work. Apparently the attribute name has changed (RC0 -> RC1), and the workflow activity wasn't updated. (http://social.technet.microsoft.com/Forums/en-IE/ilm2/thread/9b159188-3e57-4623-ae89-95041654e899)I have raised an issue related to this on the connect site also: https://connect.microsoft.com/site433/feedback/details/534908/function-evaluator-workflow-activity-contains-invalid-selection-optionsThanks,Mark[EDIT] Upon looking at the notification emails which were sent, I noticed that in the table provided by[//RequestParameter/AllChangesAuthorizationTable] , both the old value and the new value column show the same data (the new value).
February 19th, 2010 10:08pm

Mark,This notiifcation should be in AuthZ phase for old value and new value to be displayed correctly. By the action phase changes would have already been made on the object and hence both the columns have same data.Try having this notiifcation in the AuthZ phase of MPR.Thanks,Sri
Free Windows Admin Tool Kit Click here and download it now
February 20th, 2010 2:51am

Thanks Sri, this fixed the problem of having the new and old attributes displaying incorrectly.However, now the notification is sent prior to the approval request being completed.For example, if I have the following MPRs and Workflows:1. MPR: Human Resources must approve changes to selected attributes1a. WF: Send approval request to HR2. MPR: Users are notified of changes to selected attributes of their accounts2a. WF: Notify target user of attribute changesIn this situation, if the notification is in the AuthZ phase, the notification gets sent at the same time as the approval request, meaning that the request has not been approved yet. So, in effect, the notification would be saying "Someone has requested a change for this (or these) attribute, but the request has not been processed yet." But with an Action phase workflow, the notification would be limited to saying "An attribute has changed, and here is the new value", since it doesn't have access to the initial value of the attribute.I thought I might be able to store the data (in the AuthZ phase) in a custom attribute bound to the Request object, and then pick it up later in the Action Phase. So, I created the attribute 'RequestData' and bound it to the Request object, then in the approval workflow, I added a Function Evaluator activity with [//Request/RequestData] as the destination and [//RequestParameter/AllChangesAuthorizationTable] as the value. However, the Function Evaluator activity wouldn't validate; it complained about the format of [//Request/RequestData].So, aside from creating a custom workflow activity, is there a way to display both the new and old values of the changed attribute in a notfication _after_ an approval activity has completed?Thanks,Mark
February 22nd, 2010 5:59pm

Mark,I think you can accomplish this only by writing custom activity. You may need to store data on request object in AuthZ phase using updateresourceactivity and then in th action phase, you can use read resource activity to retrieve the data and pass this notification acitivty.Thanks,Sri
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2010 7:17pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics