To send the data from the Action Center via email , follow these steps:
- Use ‘Get Form Task Data’ or similar activity* to retrieve the data from the Action Center task that has been completed.
- Assign Variables*: Extract the data from the task into variables. You can create a string variable for each data point like
name
,dateOfIssue
,dueDate
, andinvoiceNumber
. - Format the Email Content*: Create a string that will serve as the email body. You can use HTML or plain text formatting. Here’s an example in plain text:
emailBody = "Name: " + name + Environment.NewLine +
"Date of Issue: " + dateOfIssue.ToString(“dd/MM/yyyy”) + Environment.NewLine +
"Due Date: " + dueDate.ToString(“dd/MM/yyyy”) + Environment.NewLine +
"Invoice Number: " + invoiceNumber.ToString()
- Send Email*:
- Use either the
Send SMTP Mail Message
activity for SMTP servers orSend Outlook Mail Message
activity for Outlook. - Configure the activity properties:
- To: The recipient’s email address.
- Subject: The subject of your email.
- Body:
emailBody
from the previous step. - Attachments: If you need to send the Excel file or any other documents, use the attachments collection to add them.
- Error Handling*: Include error handling logic to manage any exceptions that might occur during the email sending process.