Building automation for mailing purposes and stumbled upon one logical issue, which is “How can I programmatically make a script that would be able to act upon multiple IF conditions?”
I’ve got A, B, C, D types of recipients of my email and now I need to come up with an email accordingly.
Looks like the original If-Statement Activity is helpful in case when true or false answer can be given only. What should I do when:
if the recipient is A - send 1
if the recipient is B - send 2
if the recipient is C - send 3
Thank you, I would like to try your approach let me just put a little bit more context into my scenario first, to see if it is applicable here.
We’ve got a data table, where one of its columns stores email addresses and another one stores labels, let say label1, label2, label3. So eventually we have got something like that:
Apparently we have looped through this table using for each row and now we’d like to start sending emails, where if it comes to label1, please, send it to one@mail.com and so on respectively. As you may guess, addresses might be changing dynamically, but those labels are constant.
Now, my question is…how to update emails in that dictionary having a data table as a place where normally they are being stored?
@Yoichi
Not a single drop of misunderstanding here, thank you!
Following your advice, I have tried to declare a dictionary variable first that now looks like this:
EmailDictionary (System.Dictionary<.String> ,<.String>)= {{“label1”,“Message for lavel1”,
{“label2”,“Message for label2”}
}
Actually, since it’s got an error the variable won’t be declared and now I need to figure out why. It seems to me that the problem is with syntax. Looking onto your example I would like to understand what is the proper way to declare a dictionary variable.
Going forward, if I understand correctly “Message for lavel1” is a message’s body content, can some graphics like .jpg be embedded in here?