function simplenews_help in Simplenews 3.x
Same name and namespace in other branches
- 8.2 simplenews.module \simplenews_help()
- 8 simplenews.module \simplenews_help()
- 5 simplenews.module \simplenews_help()
- 6.2 simplenews.module \simplenews_help()
- 6 simplenews.module \simplenews_help()
- 7.2 simplenews.module \simplenews_help()
- 7 simplenews.module \simplenews_help()
Implements hook_help().
File
- ./
simplenews.module, line 652 - Simplenews node handling, sent email, newsletter block and general hooks.
Code
function simplenews_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.simplenews':
$help = "<p>" . t('Simplenews publishes and sends newsletters to lists of subscribers. Both anonymous and authenticated users can opt-in to different mailing lists.') . "</p>\n";
$help .= "<p>" . t('Simplenews uses nodes for <strong>newsletter issues</strong>. Newsletter issues are grouped in a <strong>newsletter</strong>. Enabled Node types are selectable. A newsletter is send to all email addresses which are subscribed to the newsletter. Newsletter issues can be sent only once. Large mailings should be sent by cron to balance the mailserver load.') . "</p>\n";
$help .= "<p>" . t('Simplenews adds elements to the newsletter node add/edit form to manage newsletter format and sending of the newsletter issue. A newsletter issue can be sent for test before sending officially.') . "</p>\n";
$help .= "<p>" . t('Both anonymous and authenticated users can <strong>opt-in and opt-out</strong> to a newsletter. A confirmation message is sent to anonymous users when they (un)subscribe. Users can (un)subscribe using a form and a block. A <strong>subscription block</strong> is available for each newsletter offering a subscription form, a link to recent newsletters and RSS feed. Email addresses can also be imported and exported via the subscription administration pages.') . "</p>\n";
$help .= "<h2>" . t('Configuration') . "</h2>\n";
$help .= '<ul>';
if (\Drupal::currentUser()
->hasPermission('administer permissions')) {
$link = Link::fromTextAndUrl(t('Configure permissions'), Url::fromRoute('user.admin_permissions'), [
'fragment' => 'module-simplenews',
]);
$help .= '<li>' . $link
->toString() . "</li>\n";
}
if (\Drupal::currentUser()
->hasPermission('administer simplenews settings')) {
$link = Link::fromTextAndUrl(t('Configure Simplenews'), Url::fromRoute('simplenews.settings_newsletter'));
$help .= '<li>' . $link
->toString() . "</li>\n";
}
if (\Drupal::currentUser()
->hasPermission('administer blocks')) {
$help .= '<li>' . t('Enable a newsletter <a href=":admin_blocks">subscription block</a>.', [
':admin_blocks' => Url::fromRoute('block.admin_display')
->toString(),
]) . "</li>\n";
}
if (\Drupal::currentUser()
->hasPermission('administer simplenews settings')) {
$help .= '<li>' . t('Manage your <a href=":newsletters">newsletters</a>, <a href=":sent">sent newsletters</a> and <a href=":subscriptions">subscriptions</a>.', [
':newsletters' => Url::fromRoute('simplenews.newsletter_list')
->toString(),
':sent' => Url::fromUri('base:admin/content/simplenews')
->toString(),
':subscriptions' => Url::fromUri('base:admin/people/simplenews')
->toString(),
]) . "</li>\n";
}
$help .= '</ul>';
$help .= "<p>" . t('For more information, see the online handbook entry for <a href=":handbook">Simplenews</a>.', [
':handbook' => 'http://drupal.org/node/197057',
]) . "</p>\n";
return $help;
case 'node.add':
$type = $route_match
->getParameter('node_type');
$help = '';
if ($type
->id() == 'simplenews_issue') {
$help = '<p>' . t('Add this newsletter issue to a newsletter by selecting a newsletter from the select list. To send this newsletter issue, first save the node, then use the "Newsletter" tab.') . "</p>\n";
if (\Drupal::currentUser()
->hasPermission('administer simplenews settings')) {
$help .= '<p>' . t('Set default send options at <a href=":configuration">Administration > Configuration > Web services > Newsletters</a>.', [
':configuration' => Url::fromRoute('simplenews.newsletter_list')
->toString(),
]) . "</p>\n";
}
if (\Drupal::currentUser()
->hasPermission('administer newsletters')) {
$help .= '<p>' . t('Set newsletter specific options at <a href=":configuration">Administration > Content > Newsletters</a>.', [
':configuration' => Url::fromUri('base:admin/content/simplenews')
->toString(),
]) . "</p>\n";
}
}
return $help;
case 'simplenews.settings_newsletter':
$help = '<ul>';
$help .= '<li>' . t('These settings are default to all newsletters. Newsletter specific settings can be found at the <a href=":page">newsletter\'s settings page</a>.', [
':page' => Url::fromRoute('simplenews.newsletter_list')
->toString(),
]) . "</li>\n";
$help .= '<li>' . t('Install <a href=":swift_mail_url">Swift Mailer</a> to send HTML emails or emails with attachments (both plain text and HTML).', [
':swift_mail_url' => 'https://www.drupal.org/project/swiftmailer',
]) . "</li>\n";
$help .= '</ul>';
return $help;
case 'simplenews.newsletter_list':
$help = '<p>' . t('Newsletter allow you to send periodic e-mails to subscribers. See <a href=":manage_subscribers">Newsletter subscriptions</a> for a listing of the subscribers', [
':manage_subscribers' => Url::fromUri('base:admin/people/simplenews')
->toString(),
]);
return $help;
case 'simplenews.newsletter_add':
$help = '<p>' . t('You can create different newsletters (or subjects) to categorize your news (e.g. Cats news, Dogs news, ...).') . "</p>\n";
return $help;
case 'entity.entity_view_display.node.default':
$type = $route_match
->getParameter('node_type');
$help = $type
->id() == 'simplenews_issue' ? '<p>' . t("'Email:HTML' display settings apply to the HTML content of emails sent in HTML format. 'Email:Plain' display settings apply to emails sent in plain text format and the plain text alternative content of emails sent in HTML format.") . "</p>\n" : '';
return $help;
}
}