How do I get the value "xyz@gmail.com" to be read in Switch as an email with "gmail.com" in the 0 value?
How do I get the value "xyz@gmail.com" to be read in Switch as an email with "gmail.com" in the 0 value?
Hi,
Have you read about Switch in help docs? - http://zennolab.com/wiki/en:logic#switch
Hi. If I understood you right then first you have to do regex and get email service from your email. When you get gmail.com in separate variable then you can set gmail.com in 0 in switch and set this new variable to check against.
string email = project.Variables["email"].Value.Substring(project.Variables["email"].Value.IndexOf('@') + 1);
//uncomment for debugging
//return email;
switch (email)
{
case "gmail.com":
return "gmail";
break;
case "outlook.com":
return "outlook";
break;
default:
return "bad email";
}
Yes, I am having difficulty with getting it to identify specific emails.
If I have 2 different emails (i.e. gmail and outlook) then I have to create variables for both?