Here is an example of C# code if you need to create a rule in Crossware console for Exchange or M365, which will trigger a signature for 2 criteria: a specific string at the beginning of the subject (ie: subject starts with [P]) and checks if the sender is a member of a group.
See below the C# code:
List < string > lSubject;
bool bMember;
string strSubject;
string strTest = "";
string strCheck = "[P]";
bMember = (!groupmember group = "CW-Test"
name = "(!username!)"!);
if (bMember) {
if (pEmailHeaders.ContainsKey("subject")) {
lSubject = pEmailHeaders["subject"];
strSubject = lSubject[0];
if (strSubject.Length > 3) {
strTest = strSubject.Substring(0, 3);
}
if (strTest == strCheck) {
lSubject[0] = strSubject.Substring(strCheck.Length, strSubject.Length - strCheck.Length);
pEmailHeaders["subject"] = lSubject;
return true;
}
}
}
return false;
Comments
0 comments
Article is closed for comments.