Workflow Email Object

When I execute a workflow the first task sends an email notification our code traps for the "OnSendMail" event and evaluate the AUser, TaskIns objects and all is good. When a task items expires and we send an email via the Email Object both the AUser, TaskIns objects are not assigned.

How can we get the name of the user for the task that fired the expired process and call the Email Object?

    if Assigned(AUser) then
      FromName := AUser.UserName
    else if Assigned(TaskIns) then
      FromName := ConvertEmailAddress(TaskIns.UserID)
    else
      FromName := '';

One thing you can do is use variables (which are a "standard" way to "pass" information from one block to another). You should manage to set a variable "UserName" in workflow when a task is created, and then use that variable in the SendMail block.

Hi Wagner,

Sorry if I was unclear. From an email block I would like to specify a From Name and pass this to the .OnEmail Event but both the TaskIns: TTaskInstance; AUser: TWorkflowUser; are unassigned. The AEmailInfo: TEmailInformation contains the From value but it not the name of the user that started the workflow.

How can I change the AEmailInfo.From value or pass this infromation to the OnEmail event?

Any chance that the Email block will include a From Name field in the near future?

Thanks

Ron

Do I understand that adding a "From" field in SendMail block, which can use variable macros, solves your problem? If yes, then we could add it, yes.

That would work!

Great, next version will include it.

Hi Wagner,

Sound good! One other small item on the desktop view there is a date that displays when a task will expire, can that include the time?

Thx

Ron