You are here

function mailhandler_help in Mailhandler 6

Same name and namespace in other branches
  1. 5 mailhandler.module \mailhandler_help()
  2. 6.2 mailhandler.module \mailhandler_help()
  3. 7.2 mailhandler.module \mailhandler_help()
  4. 7 mailhandler.module \mailhandler_help()

Implementation of hook_help().

Related topics

File

./mailhandler.module, line 132
Mailhandler module code.

Code

function mailhandler_help($path = 'admin/help#mailhandler', $arg) {
  $output = '';

  // Gather examples of useful commands, and build a definition list with them:
  $commands[] = array(
    'command' => 'taxonomy: [term1, term2]',
    'description' => t('Use this to add the terms <em>term1</em> and <em>term2</em> to the node.<br />
                      Both of the terms should already exist. In case they do not exist already, they will be quietly ommitted'),
  );
  $commands[] = array(
    'command' => 'taxonomy[v]: [term1, term2]',
    'description' => t('Similar to the above: adds the terms <em>term1</em> and <em>term2</em> to the node, but uses the vocabulary with the vocabulary id <em>v</em>. For example <em>taxonomy[3]</em> will chose only terms from the vocabulary which id is 3.<br />
                      In case some of the terms do not exist already, the behavior will depend on whether the vocabulary is a free tagging vocabulary or not. If it is a free tagging vocabulary, the term will be added, otherwise, it will be quietly ommitted'),
  );
  $commands_list = '<dl>';
  foreach ($commands as $command) {
    $commands_list .= '<dt>' . $command['command'] . '</dt>';
    $commands_list .= '<dl>' . $command['description'] . '</dl>';
  }
  $commands_list .= '</dl>';
  switch ($path) {
    case 'admin/help#mailhandler':
      $output = '<p>' . t('The mailhandler module allows registered users to create or edit nodes and comments via e-mail. Users may post taxonomy terms, teasers, and other post attributes using the mail commands capability.  This module is useful because e-mail is the preferred method of communication by community members.') . '</p>';
      $output .= '<p>' . t('The mailhandler module requires the use of a custom mailbox.  Administrators can add mailboxes that should be customized to meet the needs of a mailing list. This mailbox will then be checked on every cron job. Administrators may also initiate a manual retrieval of messages.') . '</p>';
      $output .= '<p>' . t('This is particularly useful when you want multiple sets of default commands. For example , if you want to authenticate based on a non-standard mail header like Sender: which is useful for accepting submissions from a listserv. Authentication is usually based on the From: e-mail address.  Administrators can edit the individual mailboxes when they administer mailhandler.') . '</p>';
      $output .= t('<p>You can</p>
<ul>
<li><a href="@run-cron">run cron</a> to retrieve messages from all cron enabled mailboxes.</li>
<li>list mailboxes at <a href="@admin-mailhandler">Administer &gt;&gt; Content management &gt;&gt; Mailhandler</a>.</li>
<li>add a mailbox at <a href="@admin-mailhandler-add">Administer &gt;&gt; Content management &gt;&gt; Mailhandler &gt;&gt; Add  mailbox.</a></li>
<li>set default commands, (password, type, taxonomy, promote, status), for how to work with incoming mail at <a href="%admin-mailhandler">Administer &gt;&gt; Content management &gt;&gt; Mailhandler</a> and select <strong>edit</strong> for the email address being handled.  Set commands in the default command field.</li>
<li>post email, such as from a mailing list, to a forum by adding the term id (number found in the URL) to the default commands using <strong>tid: #</strong>.</li>
<li>alter mailhandler settings (default content type and cron threshold) at <a href="@admin-mailhandler-settings">Administer &gt;&gt; Site configuration &gt;&gt; Mailhandler</a>.</li>
</ul>', array(
        '@run-cron' => url('admin/logs/status/run-cron'),
        '@admin-mailhandler-add' => url('admin/content/mailhandler/add'),
        '@admin-mailhandler' => url('admin/content/mailhandler'),
        '@admin-mailhandler-settings' => url('admin/settings/mailhandler'),
      ));
      $output .= '<h3 id="commands">' . t('Useful Commands') . '</h3>';
      $output .= $commands_list;
      $output .= '<p>' . t('For more information please read the configuration and customization handbook <a href="@mailhandler">Mailhandler page</a>.', array(
        '@mailhandler' => url('http://www.drupal.org/handbook/modules/mailhandler', array(
          'absolute' => TRUE,
        )),
      )) . '</p>';
      return $output;
    case 'admin/content/mailhandler':
      return t('The mailhandler module allows registered users to create or edit nodes and comments via email. Authentication is usually based on the From: email address. There is also an email filter that can be used to prettify incoming email. Users may post taxonomy terms, teasers, and other node parameters using the Command capability.');
    case 'admin/content/mailhandler/add':
      return t('Add a mailbox whose mail you wish to import into Drupal. Can be IMAP, POP3, or local folder.');
    case 'admin/content/mailhandler/edit/%':
      return t('Edit the mailbox whose mail you wish to import into Drupal. Can be IMAP, POP3, or local folder.');
    case 'admin/settings/mailhandler':
      return t('The mailhandler module allows registered users to create or edit nodes and comments via e-mail.');
  }
}