Creating and logging a custom activity

C F asked on April 23, 2019 18:22

I have created a Contact group with the following condition:

memberships = Contact.Users.FirstItem.OtherBindings.MembershipUsers;
if (Contact.Users.FirstItem != null && Contact.Users.FirstItem.OtherBindings.MembershipUsers != null) {
  foreach (m in memberships)
    if (m.MembershipID == 2 && m.ValidTo != null && m.ValidTo.AddDays(-31) < Now && Now<m.ValidTo.AddDays(-29)) {
      return true;

It fills the Contact group with contacts whose users have a certain membership that is expiring within 30 days. At this point, I need to execute a marketing automation process on these contacts, but there are no suitable triggers to initiate it.

Is there a way to log an activity when the Contact is added to the Contact group? What about using the macro code above to create and log a custom activity?

Recent Answers

Roman Hutnyk answered on April 24, 2019 09:01

Why don't you log an activity through API whenever you add a contact to a group?

Here is documentation on related topic.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.