Send mail activity body and subject line automated message

hi, I am trying to send mail body with below infobut time stamp not captured. I did create assign activity for current date and time like DateTime.Now for start and end time.pls check below…
“The BOT " + process_Name + " execution has been successfully completed.
Execution Start Time: " + startTime.ToString() + "
Execution End Time: " + end_time.ToString() + "
Total Execution Time: " + total_execution_time.ToString() + " seconds.”

But it was written like below when mail received in inbox…

the BOT execution has been successfully completed.

Execution Start Time: 01/01/0001 00:00:00
Execution End Time: 01/01/0001 00:00:00
Total Execution Time: 00:00:00 seconds.

Can you pls help how to get timestamps for start and end , process name in email body replacing with variables.
and for subject line with processname

Hi,

Did you by any chance Assign all those variables in another workflow? Since all those variables seems to have ‘null’ value therefore it shows nothing in your automated message.
If yes, you need to make sure that you pass the right argument with the right value to this workflow, and make sure to run/debug from the workflow that assigns those variables.

Regards,

yes, I created in different flow where process execution starts and ends… so … I created arguements like below…

here assign activities in other workflow,

Arguements in sendmail workflow…

Any help appreciated.

Hi @r0818

Please try this & let us know:

startTime = Now;
(DateTime Var)

endTime = Now;
(DateTime Var)

timeDifference = endTime - startTime;
(TimeSpan Var)

executionTimeInMinutes = timeDifference.TotalMinutes;
(Double Var)

Hope this helps,
Best Regards.

1 Like

@r0818

  1. First use some log messages and check if the values of each variable is proper…
  2. Use break points and run in debug mode and check if the values are changing and if so check if they are assigned properly to the arguments

Hope this helps

Cheers

1 Like

Hi @r0818

I’ve created a mockup for your case. Please check if the concept of passing the arguments is the same in your project. In my mockup please debug the file from the AssignVariables.xaml.

Cheers,

Forum_SendMailWithVariables.zip (149.2 KB)

1 Like

Sure, I will check. Thank you

Thank you so much, sure… I will check. Thank you for creating sample for me to get understand.