Answers.Body: <p>I'm not quite sure what your workflow is, but I think you will need to use the "Membership is changed" trigger for when the payment is made and the conditions for status changes. If the status goes straight to "new" for the offline route you probably need to use the "Membership is added" trigger with appropriate conditions. You need to map out the logic of it all and it can be a bit complex.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-10T07:46:18.330Z
Answers.Text: Thanks for the tip - I added a few words about the workflow to my original post.
  I'll try to play with the "membership is changed" trigger. 
  
  But tell me if I get it right: for online payments Civi creates membership with "pending" status and then changes it to "new" after the payment, and for offline (bank transfer) it goes straight to "new"? Isn't it the other way round? (I'm almost certain that the membership with pending transaction is in "pending" status).
Answers.UserDisplayName: Michał Grabowski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-10T09:24:46.077Z
Answers.Text: We may be using different terminology. By offline I meant entered entirely by the admin person (e.g. form and cheque in the post). But I think you mean signup online and payment being sent later and processed by admin. My online was using a payment processor. Looking at the activities (for fully online) there is an entry of change of status from pending to new, but when I was setting up a similar action with CiviRule I had to do some experimenting to get what I wanted.
Answers.UserDisplayName: Mick Kahn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-10T21:25:07.673Z
Answers.Text: You're right - I have a contribution page with membership signup and for me "online" means paid entirely by a payment processor, and "offline" is a deferred payment processed by admin.
  I think I'll first log all membership changes for both cases and then adjust conditions and my acion code accordingly.
Answers.UserDisplayName: Michał Grabowski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-09T22:48:25.243Z
Answers.LastActivityDate: 2019-09-09T22:48:25.243Z
Answers.UserDisplayName: Mick Kahn
Answers.Body: <p>It might well be that this turns out to be a situation that you can not solve with the current set of conditions. It is possible though to develop your own conditions (or have someone develop them for you). </p>
  
  <p>Some conditions would be generic and could be part of the CiviRules extension as it will help other users too, others can be specific for a certain organization and reside in their own specific extension. I work with quite a few organizations that develop their own specific conditions and actions.</p>
  
  <p>Documentation on how to create your own condition and actions can be found here: <a href="https://docs.civicrm.org/civirules/en/latest/create-your-own-condition/" rel="nofollow noreferrer">https://docs.civicrm.org/civirules/en/latest/create-your-own-condition/</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-22T10:25:37.663Z
Answers.Text: Thanks. I have my own actions and was looking for a more generic set of triggers/conditions to do what I needed. To tell the truth, I forgot I can develop my own contitions - thanks again.
Answers.UserDisplayName: Michał Grabowski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-12T07:31:54.530Z
Answers.LastActivityDate: 2019-09-12T07:31:54.530Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I need to trigger an action after membership is added, but only after the payment has been made (or registered by admin, because I have the option for online payment as well as "offline" money transfer). </p>
  
  <p>If I use "membership is added" trigger, the action is fired even if the user chose the deferred option. I tried to limit it with "membership status" condition, but then it didn't fire at all (I guess the status isn't ready yet at that point).</p>
  
  <p>Is there a way to achive that in CiviRules?</p>
  
  <p>Edit:</p>
  
  <p>A word about my wokflow, which is rather simple:
  I have different levels of membership (including a free one) and an option to pay online or offline.
  After a valid membership has been recorded (free, paid online or checked as paid by admin) I use a CiviRules action to create an account in an external (for CRM) system. And that's why I want only valid (active) memberships to trigger that action. I thought it would be a common and simple case :)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-10T19:08:20.510Z
Comments.Text: Could the Rule be run off a Contribution of Type = Member Dues?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-10T21:19:19.563Z
Comments.Text: I'm not sure, but in my case that's the only contribution type I plan to use.
Comments.UserDisplayName: Michał Grabowski
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-11T01:04:52.590Z
Comments.Text: sure. my point, which i didn't make very well, was to consider running the Rule off eg Payment Completed, rather than off the Membership entity.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-11T10:28:09.490Z
Comments.Text: Oh, I get it now :) I also thought about such solution, but then I would have to make some kind of distinction when the user will be renewing (extending) his membership.  I think we would have to play with condition on membership status anyway.
Comments.UserDisplayName: Michał Grabowski
Tags: <civimember><civirules><payment>
Title: CiviRules action only after completed payment for new membership
ThreadText: # CiviRules action only after completed payment for new membership
  
  (Asked by: username_0 on 2019-09-09)
  
  I need to trigger an action after membership is added, but only after the payment has been made (or registered by admin, because I have the option for online payment as well as "offline" money transfer).
  
  If I use "membership is added" trigger, the action is fired even if the user chose the deferred option. I tried to limit it with "membership status" condition, but then it didn't fire at all (I guess the status isn't ready yet at that point).
  
  Is there a way to achive that in CiviRules?
  
  Edit:
  
  A word about my wokflow, which is rather simple:
  I have different levels of membership (including a free one) and an option to pay online or offline.
  After a valid membership has been recorded (free, paid online or checked as paid by admin) I use a CiviRules action to create an account in an external (for CRM) system. And that's why I want only valid (active) memberships to trigger that action. I thought it would be a common and simple case :)
  
  **Tags:** civimember, civirules, payment
  
  > **Comments:**
  > **username_1**: Could the Rule be run off a Contribution of Type = Member Dues?  
  > **username_0**: I'm not sure, but in my case that's the only contribution type I plan to use.  
  > **username_1**: sure. my point, which i didn't make very well, was to consider running the Rule off eg Payment Completed, rather than off the Membership entity.  
  > **username_0**: Oh, I get it now :) I also thought about such solution, but then I would have to make some kind of distinction when the user will be renewing (extending) his membership.  I think we would have to play with condition on membership status anyway.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-09-09. Score: 3
  
  I'm not quite sure what your workflow is, but I think you will need to use the "Membership is changed" trigger for when the payment is made and the conditions for status changes. If the status goes straight to "new" for the offline route you probably need to use the "Membership is added" trigger with appropriate conditions. You need to map out the logic of it all and it can be a bit complex.
  
  > **Comments:**
  > **username_0**: Thanks for the tip - I added a few words about the workflow to my original post. I'll try to play with the "membership is changed" trigger.   But tell me if I get it right: for online payments Civi creates membership with "pending" status and then changes it to "new" after the payment, and for offline (bank transfer) it goes straight to "new"? Isn't it the other way round? (I'm almost certain that the membership with pending transaction is in "pending" status).  
  > **username_2**: We may be using different terminology. By offline I meant entered entirely by the admin person (e.g. form and cheque in the post). But I think you mean signup online and payment being sent later and processed by admin. My online was using a payment processor. Looking at the activities (for fully online) there is an entry of change of status from pending to new, but when I was setting up a similar action with CiviRule I had to do some experimenting to get what I wanted.  
  > **username_0**: You're right - I have a contribution page with membership signup and for me "online" means paid entirely by a payment processor, and "offline" is a deferred payment processed by admin. I think I'll first log all membership changes for both cases and then adjust conditions and my acion code accordingly.  
  
  ---
  
  ### Answer by username_3 on 2019-09-12. Score: 1
  
  It might well be that this turns out to be a situation that you can not solve with the current set of conditions. It is possible though to develop your own conditions (or have someone develop them for you).
  
  Some conditions would be generic and could be part of the CiviRules extension as it will help other users too, others can be specific for a certain organization and reside in their own specific extension. I work with quite a few organizations that develop their own specific conditions and actions.
  
  Documentation on how to create your own condition and actions can be found here: <https://docs.civicrm.org/civirules/en/latest/create-your-own-condition/>
  
  > **Comments:**
  > **username_0**: Thanks. I have my own actions and was looking for a more generic set of triggers/conditions to do what I needed. To tell the truth, I forgot I can develop my own contitions - thanks again.  
  
  ---
  
  