0

I'm using CiviCRM 5.18.4 on WordPress 5.4.1. I have been successfully using CiviRules to send a welcome email when a contact adds a (pending) membership.

Now, I have created a rule that is supposed to send a different ("Membership Confirmation") email when we confirm the person's eligibility and donation:

Linked Trigger: Membership is changed

Linked Condition(s): Membership Status is one of "New"

Linked Action(s):
Send e-mail from [our email address] using primary e-mailaddress with Template "Membership Confirmation" to the contact and bcc to [internal staff] Delay by 5 minutes

Have tried it with or without delay, and with various (simplified) email templates. Result is consistent: When we approve the donation, it successfully changes the membership status to NEW, and the Event IS TRIGGERED for that contact. However, the emails do not get sent, and the emails do not appear in the "activities" list for that contact (although the donation and membership activities do). No error is reported, and nothing at all appears in the CiviRules Log.

[Note: I just installed the CiviRules Logger extension, I haven't seen any logs appearing even on events that trigger and work properly, so I don't really know if the logger is working.]

Any ideas? Could something be wrong with the email format? Is it the way I have written the rule? Is something going wrong on the back end?

Thanks for any thoughts!

UPDATE: I did finally get an error in the Civirules log:

2020-05-12 18:00 error Rule: 'Membership Confirmation Email' with id 6 failed for contact 595 because of Failed to execute delayed action
Array

( [rule_title] => Membership Confirmation Email [original_error] => Civirules api action exception: id is not a valid integer. API call: Email.send with params: from_name="[org name]", from_email="[our email]", template_id="74", location_type_id="", alternative_receiver_address="", cc="", bcc="[internal staff email]", file_on_case="", contact_id="595", extra_data="Array"

[reason] => Failed to execute delayed action

)

Can anyone interpret that for me? Which id is not a valid integer?

  • isn't there also a civirules email extension needed? do you have that installed? – petednz - fuzion May 13 at 3:10
  • Yes. I believe it's called E-mail API (org.civicoop.emailapi). Version 1.19 installed. – David Hyman May 13 at 21:23
0

When you have a delayed email, it generates a record in the civicrm_queue_item table. Since you're experiencing the same problem without a delay, this is unlikely to solve the problem on its own, but is a good way to troubleshoot whether an email was generated while isolating confounding factors like cron not running, a bad outgoing email setting, etc.

| improve this answer | |
  • I did get an error message in the CiviRules log, which I detailed in my edit to the original; question. Does that help? – David Hyman May 13 at 21:21
0

From your error message it seems that the location_type_id is empty when you try to send the email. That might explain the error as it would expect an integer, and not empty. Could you add a location_type_id in the configuration of the send Email and see if that is a workaround for you?

The action should be able to deal with an empty location_type_id but perhaps the latest version has a little bug there?

If it does work, could you please report the issue here: https://lab.civicrm.org/extensions/civirules/-/issues? That means the developers who want to contribute can see this bug needs to be fixed.

| improve this answer | |
  • Good guess. But, no, Now I get the identical error message, except that it now reads "location_type_id="1" Any other suggestions? – David Hyman May 15 at 0:28
  • Not from reading the error message I am afraid....it would require some debugging :-) – ErikH - CiviCooP May 15 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.