I'm new to Drupal. The first thing I need is a very simple email subscription box like this: http://www.cloudstack.com/. It should allow anonymous users to subscribe. I saw several Drupal subscription modules out there but they all requires membership. Thanks a lot!

Comments

nevets’s picture

I am pretty sure Simplenews does not require membership.

weihan’s picture

I've downloaded Simplenews and it's exactly what I need! Thank you nevets!

mileZ’s picture

Hi Weihan,

I had the same prob too :-)
copy this from line 894 to 929

It works!!! I'm using this all the time.

Don't forget to activate simplenews in a block and the acces rule for the anonymous visitor.

function simplenews_block_form($tid) {
  global $user;
  $form = array();

  if ($user->uid) {
    if (simplenews_user_is_subscribed($user->mail, $tid)) {
      $submit_text = t('Unsubscribe');
      $form['action'] = array('#type' => 'value', '#value' => 'unsubscribe');
    }
    else {
      $submit_text = t('Subscribe');
      $form['action'] = array('#type' => 'value', '#value' => 'subscribe');
    }
    $form['display_mail'] = array('#type' => 'item',
      '#title' => t('E-mail'),
      '#value' => truncate_utf8($user->mail, 29, FALSE, TRUE),
    );
    $form['mail'] = array('#type' => 'value', '#value' => $user->mail);
  }
  else {
    $form['mail'] = array('#type' => 'textfield',
      '#title' => t('E-mail'),
      '#size' => 20,
      '#maxlength' => 128,
      '#required' => TRUE,
    );
    $form['action'] = array('#type' => 'value',
      '#default_value' => 'subscribe',
      '#options' => array('subscribe' => t('Subscribe')),
    );
  }

MileZ

mediamash’s picture

how would you rewrite it for adding in template.php in D6? would a prefix work:
function themename_simplenews_block_form($tid) {