You are here

function birthdays_defaults_update_7003 in Birthdays 7

Replaces the non existing token [site:uri-brief] with [site:url-brief] in the default happy birthday message.

Implements hook_update_N().

File

defaults/birthdays_defaults.install, line 83
Create a default field and action.

Code

function birthdays_defaults_update_7003() {
  $aid = variable_get('birthdays_defaults_action');
  if ($aid && ($action = actions_load($aid))) {
    $params = unserialize($action->parameters);
    $params['message'] = str_replace('[site:uri-brief]', '[site:url-brief]', $params['message'], $count);
    if ($count) {
      actions_save($action->callback, $action->type, $params, $action->label, $aid);
      return t('[site:uri-brief] has been replaced with [site:url-brief] in the default happy birthday mail action.');
    }
  }
}