Simple Rule Example Using CiviCRM Entity

The new Drupal module CiviCRM Entity exposes 11 CiviCRM objects as Drupal Entities and provides rules support for these entities.  In this article I will demonstrate how to create a simple rule which creates a synced drupal user for the contact when the contact gets a membership.

This how-to assumes you have the Rules modules and the CiviCRM Entity module installed.

Create the rule:

  • admin/config/workflow/rules/reaction/add
  • for name enter Create Synced User When Contact Gets Membership
  • For React on Event: Select 'CiviCRM Membership has been created'
  • Click Save
  • Under Actions select 'Create Linked Drupal User Account'
  • Click Continue
  • The default value for the CiviCRM contact Contact Data selector field should already be correct but ensure it is: civicrm-membership:contact-id-contact
  • Check Activate account and Send ccount notification email if you wish
  • Click save

You can extend the rule

If you would like to only create the user for a specific membership type.

  • Under Conditions click the Add Condition link
  • For the Select the condition to add field select Data Comparison
  • Under Data to Compare use the data selector find the membership type id field of the membership object. It should be this: civicrm-membership:membership-type-id
  • Click Continue
  • Under Operator select equals
  • Under Data Value enter the membership type id of the membership type you'd like to create linked drupal users for
  • click save




Block Drupal User when Membership Expires

Your steps worked perfectly for me in creating a Drupal account upon a new CiviCRM membership. I tried to create a rule to block the exiting Drupal account when the membership has been deleted with the following entries:Event: CiviCRM Membership has been deletedActions: Block a UserData Selector: civicrm-membership:contact-id-contact:civi-userThis does not seem to work. The Drupal user remains active after deleting the membership in CiviCRM.Any tips would be appreciated.



Rules CiviEntity Action Data Issues

Mark,I'm trying to create a new CiviGroup of the same name when a new Organic Group is created.Not sure what I'm mssing, but the Parameter/Variable bit is thoroughly confusing.  How do I get the current OG Group Name and pass it along to the action? Any help would be greatly appriciated. A full example would be great :D  If I can get this working I'll write the example steps up for you to post.Event:

  • After saving new content of type [OG group type]

Conditions: none (right now)Actions:

  • Create a new entity
    • Parameter: Entity type: CiviCRM civicrm_group
    • Provides variables: Title (title)

 adding a new og group sptis this out:Error messageException: Mandatory key(s) missing from params array: title in CivicrmEntityController->save() 


I am very impressed with the work you create this website, this website in my opinion is the only one of the most delicious web to visit, and the design is also very creative. Obat Miom


Dream something and make your dream a reality, due to the fact that there would be no this world if nobody dreamed and all started from a dream. penyakit tipes


Herbal medicine is a drug that is organic or natural,(cara mengobati keputihan secara alami dan cepat) just like our bodies.(cara mengatasi asam lambung naik saat puasa) Pure herbal medicine taken from an extract of plant or animal that has benefits for the treatment,(cara menurunkan berat badan saat puasa) without any mixture of chemicals artificial (synthetic).(cara mengobati ejakulasi dini secara permanen) Herbal medicine derived from plants (vegetable) for example ginger, garlic, dates, black cumin (Seed), etc.(cara menguruskan badan) Derived from animals (animal) such Teripang (Gamat), Honey, Propolis, shark oil, etc.(obat infeksi saluran kemih di apotik) In today's, with the development of medical technology is growing rapidly and the number of research studies related to the drugs,(obat benjolan di ketiak) the more open our eyes that turned out to be natural nature has provided good medicine for all ills.(obat tumor otak) Medications that are not hard to find and different drug from synthetic materials clams,(cara melangsingkan tubuh) which eventually will cause adverse effects on our body.(obat nyeri haid) We are as agent of herbal medicine that sell drugs online, the drug delivery system in advance. We are still learning how to post an article, blog, website, and here we found your blog very interesting for us take science,(obat ambeien) the science of how well the blog post. (obat ambeien) your blog is very interesting and very good for us, for that we will always continue to visit and visit,(cara mengobati stroke) see your progress in making this excellent post and we will imitate how.(obat sinusitis) Ok thank you very much for the opportunity I can read a blog that's very unusual. thanks: D Good web site below! (obat ambeien) Additionally your website a lot upward very cari tumpangan bekasi fast! Just what coordinator will you be use of? Can one get the online backlink on your own sponsor?(obat ambeien) If only the web site jam-packed as fast when your own ; ) (cara mengobati mata katarak) thanks you so much :) (obat ambeien).


Herbs or herbal medicine is a folk medicine or traditional medicine that is practiced by the use of plants and plant extracts.(obat ambeien). Herbs are also known as botanical medicine,(cara mengobati keputihan secara alami dan cepat). medical herbs, herbal medicine, herbology, Herblore, and phytotherapy. (cara menguruskan badan).The scope of herbal medicine is sometimes extended to include products of fungi and bees, as well as minerals, shells and certain animal parts.(obat tumor otak). Pharmacognosy is the study of medicines derived from natural sources. The use of traditional medicine is recognized as a way to learn about potential future drugs.(cara melangsingkan tubuh). In 2001, researchers identified 122 compounds used in the primary treatment comes from "ethnomedical" plant sources (obat benjolan di ketiak).;. 80% of the compounds used in the same or related manner as the traditional ethnomedical use.(cara mengobati mata katarak). Plants have revolutionized the ability to synthesize chemical compounds that help them defend themselves against attacks from various predators such as insects,(obat sinusitis). fungi and mammalian herbivores. By chance, some of these compounds, while toxic to plants predator,(cara melangsingkan perut) proved to have a beneficial effect when used to treat human diseases. (cara menurunkan berat badan saat puasa).The secondary metabolites vary widely in structure, many aromatic substances, (obat nyeri haid). most of which substituted phenols or their derivatives oxygen. (cara mengobati penyakit angin duduk)At least 12,000 have been isolated so far, estimated at less than 10% of the total.(cara melangsingkan tubuh secara alami). Chemical compounds in plants mediate their effects on the human body by binding to receptor molecules present in the body, (slimming capsule) the process is identical to those already well understood for conventional medicine and herbal remedies such as not differ greatly from conventional medicine in terms of how they work. (cara mengatasi asam lambung naik saat puasa). This enables herbal medicines that exist in principle be as effective as conventional drugs but also give them the same potential to cause harmful side effects.(obat infeksi saluran kemih di apotik) Many herbs and spices used by humans to season food yield useful drug compounds. (cara mengobati ejakulasi dini secara permanen)Similarly to prescription drugs, a number of herbs that are considered likely to cause adverse effects. (cara mengobati stroke)Furthermore, "forgery, improper formulation, or lack of understanding of plant and drug interactions have led to adverse reactions that are sometimes life threatening.(cara menyembuhkan mata minus)

Add new comment | Jackrabbithanna's Drupal and CiviCRM Blog

Hmm it seems like your site ate my first comment (it was extremely long) so I guess I'll just sum it
up what I had written and say, I'm thoroughly enjoying
your blog. I too am an aspiring blog blogger but I'm still new to the
whole thing. Do you have any recommendations for novice blog writers?

I'd definitely appreciate it.

Mengobati Radang Tenggorokan Secara Tradisional

Ikut Share ya My Brother<a href=""... radang tenggorokan secara tradisional</a><a href="">cara alami mengobati radang tenggorokan</a><a href="">cara alami mengobati radang tenggorokan pada anak</a><a href="">cara mengobati radang tenggorokan akut</a><a href="">cara mengobati radang tenggorokan secara alami dan cepat</a><a href="">mengobati radang tenggorokan secara alami</a> 


Produk Jelly Gamat -Not only good for health but also very useful for the treatment, Ace maxs made from mangosteen peel and soursop leaves, Had a very remarkable properties. Because the content is owned mangosteen peel is needed by the human body.recent post- Ace Maxs


Produk Jelly Gamat -Not only good for health but also very useful for the treatment, Ace maxs made from mangosteen peel and soursop leaves, Had a very remarkable properties. Because the content is owned mangosteen peel is needed by the human body.recent post- Ace Maxs


Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.