my steps are as below:
create new email
search for template based on certain query
check if any dynamic field are present or not - if present then replace
send the mail
fyi there are more than 10 dynamic fields in every template
so i am trying put all these 10 dynamic fields in config file or should i create a dictionary
Thanks @Florent_Salendres
i have 20 different templates
each template have some dynamic fields which may or may not be present another templates
for example
template1 has dynamic fields as {fullname},{birth place},{reportdata}
template2 has {first name},{reportdata}
template3 has {fullname,replybefore},{age}
etc
so how should i build a logic to find these dynamic fields and then replace all of them
should i create all known dynamic fields in dictionary ? if yes how can i acomplish
do you mean to have just one equation for all cases so i need not setup a logic to find particular dynamic field
as below
strBody = strBody.Replace(“@name”,“Florent”).Replace(“@reportdata”,“SomeDataTableOuput”).Replace(“@replybefore”,Now.ToShortDateString).
well thats solve my half problam …Thank you very much
another query is about how should build a dictionary for all these dynamic fields
{name}
{reportdata}
{replybefore}
{age}
{birthday}
{lastname}
any idea?
I would use an invoke workflow having arguments with the replacement values.
A dictionary is a viable solution if you really have many of them, coming from difference sources.
Maybe you should consider having those values in your QueueItem, if it fits your design.
To add to dictionary, you have an example on this post.
A datatable is a viable option as well, it depends on your preference.