1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- /**
- * Implement hook_user()
- *
- */
- function materio_user_rules_user_update(&$edit, $account) {
- if (!empty($account->logintoboggan_email_validated)) {
- if($subscriber = simplenews_subscriber_load_by_mail($account->mail)){
- foreach($subscriber->newsletter_subscription as $tid => $subscription){
- $term = taxonomy_term_load($tid);
- $subscriptions_text_array[] = $term->name;
- $subscriptions_tids[] = $tid;
- }
- $subscriptions_text = implode(', ', $subscriptions_text_array);
- $args = array(
- 'account' => $account,
- 'subscriptions_list' => $subscriptions_tids,
- 'subscriptions_text' => $subscriptions_text,
- );
- rules_invoke_event_by_args('materio_logintoboggan_validated', $args);
-
- }
- }
- }
- /**
- * Implements hook_simplenews_unsubscribe_user().
- */
- function materio_user_rules_simplenews_subscribe_user($subscriber, $subscription) {
- if (!empty($subscriber->logintoboggan_email_validated)) {
- $args = array(
- 'mail' => $subscriber->mail,
- 'tid' => $subscription->tid,
- );
- // rules_invoke_event_by_args('simplenews_rules_event_subscribe', $args);
- }
- }
|