Answers.Body: <p>That was the clue - put a five minute delay on the sms action - the condition is checked again and Voila the sms is sent.
  So perhaps this needs to be added to the docs. It might be only the action "send sms" that needs a delay. Sending an email or adding a tag work fine via a profile.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-11T21:33:31.247Z
Answers.Text: @Jaap Jansma - CiviCooP here I come begging for more git help. ErikH - CiviCooP gave me instructions to create a pull request that you accepted into CiviRules. I tried the same process with a patch to change the behavior noted in this question but Gitlab doesn't offer Development/Core as a destination for the merge request. Any guidance on how to merge https://lab.civicrm.org/SRQ_civicrm/core with Development/Core appreciated.
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-13T11:16:43.413Z
Answers.Text: The question is not related to the main question here. But did you check the documentation? See https://docs.civicrm.org/dev/en/latest/core/contributing/#make-changes for how to contribute to core
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-15T15:50:04.793Z
Answers.Text: Stumbled trying to submit a PR - https://lab.civicrm.org/dev/core/-/issues/2960#note_67362
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-22T20:34:55.100Z
Answers.Text: @JaapJansma-CiviCooP & KarinG-SemperIT : I ran into a similar issue but using a webform instead of a profile. Worked only with a delay. I'm a bit fuzzy but it looks like the delayed task gets a $sourceContactId = CRM_Core_Session::getLoggedInContactID(); (sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php) whereas the webform triggered one doesn't. My best guess is that the delayed task gets the ID of the rule author. BTW by "webform triggered" I mean a webform from an anonymous user creates an activity and that creation triggers the rule to send the SMS. Hmm, bug or feature?
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-22T20:37:17.317Z
Answers.Text: @KarinG-SemperIT : I thought the previous comment might interest you as well, but can't tag more than one guru.
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-28T14:35:38.127Z
Answers.LastActivityDate: 2018-06-28T14:35:38.127Z
Answers.UserDisplayName: LesleyJill
Body: <p>wordpress 4.9 civi 5.22 civirules 2.1 SMSAPI 1.5</p>
  
  <p>No activity is added and no sms is sent</p>
  
  <p>And this question doesn't meet quality standards so I'm adding some more text
  Provider is clickatell. I can send sms through Civi without using civirules. Worked fine previously. I’m not sure whether the upgrade to Civi 5.22 or the upgrade to civirules 2.1 is the cause as upgrades were contemporaneous. There are no error messages and I don’t know which logs might help. It’s 4am my time and I have been struggling for hours with a number of post upgrade issues with some excellent help from this forum. I eat muesli for breakfast, have 2 dogs  and consider civirules to be one of the most useful extensions ever (even though it is currently giving me grief. </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-27T20:16:24.230Z
Comments.Text: and some excellent extra text you have added
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-27T22:37:03.803Z
Comments.Text: This really isn't enough information to answer the question.  Consider editing it to add the following: * Who is your SMS gateway provider (Twilio, Clickatell, etc.) * Can you send SMS through CiviCRM without using CiviRules? * Can you send messages through the provider's test interface? * Can you document steps you've taken (if any) to ensure the issue is with the SMS portion and not a problem with the rule or CiviRules?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-28T00:26:48.210Z
Comments.Text: Cheers Pete . Sorry Jon G
Comments.UserDisplayName: LesleyJill
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-28T07:10:50.417Z
Comments.Text: The first thing to do is to discover whether the problem is the sms-api extension or civirules. There are two ways to find that out. The first one is to setup a simple rule (e.g. contact is added to group, then action add tag to the contact). If that one is working try to add the sms action to the same rule and see if it still working. 
  The other way to test it is to go the api explorer and use the entity SMS and action Send.
Comments.UserDisplayName: Jaap Jansma - CiviCooP
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-28T11:51:53.263Z
Comments.Text: Now I feel foolish (it was 4am!) An important piece of info. If the contact is manually added to the group in the admin backend then the SMS DOES send. It's when the contact is added to the group via a profile that the SMS does not send.
Comments.UserDisplayName: LesleyJill
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-28T22:29:59.420Z
Comments.Text: Is one of  the dogs called Civi, and the other Droop. And were they free?
Comments.UserDisplayName: petednz - fuzion
Tags: <civirules>
Title: Civirules send sms not working
ThreadText: # Civirules send sms not working
  
  (Asked by: username_0 on 2018-06-27)
  
  wordpress 4.9 civi 5.22 civirules 2.1 SMSAPI 1.5
  
  No activity is added and no sms is sent
  
  And this question doesn't meet quality standards so I'm adding some more text
  Provider is clickatell. I can send sms through Civi without using civirules. Worked fine previously. I’m not sure whether the upgrade to Civi 5.22 or the upgrade to civirules 2.1 is the cause as upgrades were contemporaneous. There are no error messages and I don’t know which logs might help. It’s 4am my time and I have been struggling for hours with a number of post upgrade issues with some excellent help from this forum. I eat muesli for breakfast, have 2 dogs and consider civirules to be one of the most useful extensions ever (even though it is currently giving me grief.
  
  **Tags:** civirules
  
  > **Comments:**
  > **username_1**: and some excellent extra text you have added  
  > **username_2**: This really isn't enough information to answer the question.  Consider editing it to add the following: * Who is your SMS gateway provider (Twilio, Clickatell, etc.) * Can you send SMS through CiviCRM without using CiviRules? * Can you send messages through the provider's test interface? * Can you document steps you've taken (if any) to ensure the issue is with the SMS portion and not a problem with the rule or CiviRules?  
  > **username_0**: Cheers Pete . Sorry Jon G  
  > **username_3**: The first thing to do is to discover whether the problem is the sms-api extension or civirules. There are two ways to find that out. The first one is to setup a simple rule (e.g. contact is added to group, then action add tag to the contact). If that one is working try to add the sms action to the same rule and see if it still working.  The other way to test it is to go the api explorer and use the entity SMS and action Send.  
  > **username_0**: Now I feel foolish (it was 4am!) An important piece of info. If the contact is manually added to the group in the admin backend then the SMS DOES send. It's when the contact is added to the group via a profile that the SMS does not send.  
  > **username_1**: Is one of  the dogs called Civi, and the other Droop. And were they free?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-06-28. Score: 3
  
  That was the clue - put a five minute delay on the sms action - the condition is checked again and Voila the sms is sent.
  So perhaps this needs to be added to the docs. It might be only the action "send sms" that needs a delay. Sending an email or adding a tag work fine via a profile.
  
  > **Comments:**
  > **username_4**: @JaapJansma-CiviCooP & KarinG-SemperIT : I ran into a similar issue but using a webform instead of a profile. Worked only with a delay. I'm a bit fuzzy but it looks like the delayed task gets a $sourceContactId = CRM_Core_Session::getLoggedInContactID(); (sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php) whereas the webform triggered one doesn't. My best guess is that the delayed task gets the ID of the rule author. BTW by "webform triggered" I mean a webform from an anonymous user creates an activity and that creation triggers the rule to send the SMS. Hmm, bug or feature?  
  > **username_4**: @KarinG-SemperIT : I thought the previous comment might interest you as well, but can't tag more than one guru.  
  > **username_4**: @username_3 here I come begging for more git help. ErikH - CiviCooP gave me instructions to create a pull request that you accepted into CiviRules. I tried the same process with a patch to change the behavior noted in this question but Gitlab doesn't offer Development/Core as a destination for the merge request. Any guidance on how to merge https://lab.civicrm.org/SRQ_civicrm/core with Development/Core appreciated.  
  > **username_3**: The question is not related to the main question here. But did you check the documentation? See https://docs.civicrm.org/dev/en/latest/core/contributing/#make-changes for how to contribute to core  
  > **username_4**: Stumbled trying to submit a PR - https://lab.civicrm.org/dev/core/-/issues/2960#note_67362  
  
  ---
  
  