Pages: 1
RSS
Templates: Lastname cleanup
 
Hello,

edit: my apologies: I've posted in the wrong forum. Can a moderator please move it? Thank you.


The emails I get from my main client uses the following sender format:
Code
"John Smith (Microsoft)" <ts@microsoft.com>



In my reply template I want to Greet the person with his or her lastname:

Code
Hello %TOLNAME,


which results in

Code
Hello (Microsoft),


instead of

Code
Hello Smith,


If I add the person to the Adressbook the problem appears again: The "company" suffix is filled in at the Lastname field, the actual Lastname is filled in the middle name. Now, I've tried to counter-react on this feature and attempted to use %TOMNAME (Middlename) if I detect brackets in the lastname. However there is no such Variable.

Am I missing something? How can I achieve my goal?
Is there a way to extract the "Smith" part from whole %TONAME?


PS: The solution to add the Person to the addressbook first, then use %ABTOMiddleName is no good: I don't have the time to add everyone I want to reply to the address-book first.

Thanks!

Marc
Edited: frame - 04 September 2008 02:24:25
 
*bump*

No one has any suggestions?
 
Try this %IF with simple regexps:

Code
Hello %IF:`%SETPATTREGEXP='\(.+?\)'%REGEXPMATCH(%TOLNAME)`!=``:`%-
%SETPATTREGEXP='([\w\-]*)\s*\(.+?\)$'%REGEXPMATCH(%TONAME)`:`%TOLNAME`,

Pages: 1