function simplenews_token_info in Simplenews 8
Same name and namespace in other branches
- 8.2 simplenews.tokens.inc \simplenews_token_info()
- 7.2 simplenews.tokens.inc \simplenews_token_info()
- 7 simplenews.tokens.inc \simplenews_token_info()
- 3.x simplenews.tokens.inc \simplenews_token_info()
Implements hook_token_info().
File
- ./
simplenews.tokens.inc, line 16 - Token related hook implementations.
Code
function simplenews_token_info() {
$types['simplenews-subscriber'] = array(
'name' => t('Simplenews subscriber'),
'description' => t('Tokens related to the newsletter recipient'),
'needs-data' => 'simplenews_subscriber',
);
$types['simplenews-newsletter'] = array(
'name' => t('Simplenews newsletter'),
'description' => t('Tokens related to the newsletter'),
'needs-data' => 'newsletter',
);
// Tokens for simplenews subscriber.
$subscriber['subscribe-url'] = array(
'name' => t('Subscription URL'),
'description' => t('The URL of the page where the subscription is confirmed.'),
);
$subscriber['unsubscribe-url'] = array(
'name' => t('Unsubscribe URL'),
'description' => t('The URL of the page where the cancellation of the subscription is confirmed.'),
);
$subscriber['manage-url'] = array(
'name' => t('Manage URL'),
'description' => t('The URL of the page where the subscribers can manage their newsletter subscriptions.'),
);
$subscriber['combined-url'] = array(
'name' => t('Combined confirmation URL'),
'description' => t('The URL of the page where subscribers can confirm their subscription changes.'),
);
$subscriber['mail'] = array(
'name' => t('Subscriber email'),
'description' => t('The email address of the newsletter receiver.'),
);
$subscriber['user'] = array(
'name' => t('Corresponding user'),
'description' => t('The user object that corresponds to this subscriber. This is not set for anonymous subscribers.'),
'type' => 'user',
);
// Tokens for simplenews newsletter.
$newsletter['name'] = array(
'name' => t('Newsletter'),
'description' => t('The name of the newsletter.'),
);
$newsletter['url'] = array(
'name' => t('Newsletter URL'),
'description' => t('The URL of the page listing the issues of this newsletter.'),
);
return array(
'types' => $types,
'tokens' => array(
'simplenews-subscriber' => $subscriber,
'simplenews-newsletter' => $newsletter,
),
);
}