function simplenews_help in Simplenews 8
Same name and namespace in other branches
- 8.2 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()
- 3.x simplenews.module \simplenews_help()
Implements hook_help().
File
- ./
simplenews.module, line 813 - 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'), array(
'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>.', array(
':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>.', array(
':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>.', array(
':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>.', array(
':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>.', array(
':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>.', array(
':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).', array(
':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', array(
':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("'Plain' display settings apply to the content of emails send in plain text format. 'HTML' display settings apply to both HTML and plain text alternative content of emails send in HTML format.") . "</p>\n" : '';
return $help;
}
}