I'm using now the following piece of code:
var contact = OnlineMarketingContext.GetCurrentContact();
The problem I'm facing is: when I let the scheduled task "Process activities log" to run automatically, the code works; if I run the task manually, the variable contact contains the user I'm using to run it (Global administrator).
More or less, it's the same behavior I get when I move the Automation Process to a given action block manually (it loses the real current contact, returning the logged user).
How can I solve it?
Regards
Emanuele Firmani