I am doing automation where I have to send a Mail which consists of a format (which is in Config) where the “Name”, “Role”, and “Company Name” are saved in Queues.
So my question is, how can I use these variables which will change the mail body content respectively.
You want to pass that values in the body of the mail
If so you can use replace
create a dummy names like name,role and company in the body template in config.
You can tag some words in body text then replace them with the specific content from the queue
Like this
Your body text
Following the request information
Name: #name
Role: #role
Company Name: #company
In assign activity you can
body = body.Replace("#name", in_TransactionItem.SpecificContent("Name").ToString)
body = body.Replace("#role", in_TransactionItem.SpecificContent("Role").ToString)
body = body.Replace("#company", in_TransactionItem.SpecificContent("Company Name").ToString)
Assign: Name = item.SpecificContent(“Name”).ToString
Assign: Role = item.SpecificContent(“Role”).ToString
Assign: CompanyName = item.SpecificContent(“CompanyName”).ToString
Assign: MailBody = String.Format(“Hello {0},\n\nYour role at {1} is {2}.”, Name, CompanyName, Role)
Send Outlook Mail Message (or Send SMTP Mail Message)
To: “recipient@example.com”
Subject: “Your Subject”
Body: MailBody