You are here

function mailchimp_automations_entity_insert in Mailchimp 7.5

Same name and namespace in other branches
  1. 7.4 modules/mailchimp_automations/mailchimp_automations.module \mailchimp_automations_entity_insert()

Implements hook_entity_insert().

File

modules/mailchimp_automations/mailchimp_automations.module, line 59
Module file for mailchimp_automations.

Code

function mailchimp_automations_entity_insert($entity, $type) {
  $wrapper = entity_metadata_wrapper($type, $entity);
  $bundle = $wrapper
    ->getBundle();
  if ($automation_entity = mailchimp_automations_entity_automation($type, $bundle)) {
    mailchimp_automations_trigger_workflow($automation_entity, $wrapper);
  }
}