In my confirmation email the !mail_to and !site variables are working properly, but the !newsletter and !confirmation_url are not. This is the case either using the subscription form within the newsletter block or following a link to the form. You can see the form at http://openspace.coop/latest. Any idea what I'm doing wrong?

We have received a request for subscription of me@myaddress.org  to the !newsletter on OpenSpace website at http://openspace.coop. To confirm this subscription please use the link below.

!confirmation_url 

Many thanks,
Matt

Comments

sutharsan’s picture

Status: Active » Fixed

With the latest release some of the variables have changed. See the description.

Available variables are: !site, !uri, !uri_brief, !mailto, !date, !newsletter_name, !confirm_subscribe_url, !confirm_unsubscribe_url.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

catofcheshir’s picture

!site & !mailto doesn't work for anonymous subscribers, because this tokens get from user_mail_tokens() :(

catofcheshir’s picture

Category: support » bug
Status: Closed (fixed) » Active
donquixote’s picture

subscribe

Anonymous’s picture

subscribe

Same issue here using Drupal 6.11 and simplenews 6.x-1.0-rc6

arnoldc’s picture

Same issue here, !mailto and !site are not working in RC6 for annoymous users.

phdhiren’s picture

subscribing

mcarrera’s picture

subscribe

Roberto Gerola’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc4

In simplenews.module file, around line 2120, this code should fix the issue :

  // Get tokens from user_mail_tokens() and add simplenews variables.
  if($subscription->uid) {
    $vars = user_mail_tokens($subscription, $language);
  }
  else {
    $vars = array();
    $vars['!site'] = variable_get('site_name', 'Drupal');
    $vars['!mailto'] = $subscription->mail;
  }

If necessary, other variables can be found here :
http://api.drupal.org/api/function/user_mail_tokens

Roberto
--
http://speedtech.it

vendeka’s picture

subscribing

benkewell’s picture

Version: 6.x-1.0-rc4 » 6.x-1.x-dev

issue in #3 still occurs in rc6 and dev,
patch in #10 solves the problem

ñull’s picture

Version: 6.x-1.0-rc4 » 6.x-1.x-dev
Status: Active » Reviewed & tested by the community
StatusFileSize
new1.22 KB

The same patch as #10 but now attached in CVS patch file against HEAD. May be this helps the maintainer to include it?

pcorbett’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc6

Patch #13 worked for me.

nadavoid’s picture

I too have tested this patch, and it works great. Seems like an absolute necessity to be added to the module. Hoping a maintainer can apply this patch soon and have it in rc7.

sutharsan’s picture

Status: Reviewed & tested by the community » Fixed

Although I have not been able to reproduce the error I have committed the patch to HEAD and 6.x-1.x-dev. Thanks Roberto Gerola and com2.

plebe’s picture

inserting manually the #13 code worked for me, couldn't get the patch to run properly. Probably just me not knowing how to apply patch.

sutharsan’s picture

No need to apply the patch, use the latest 6.x-1.x-dev release. Please report your test results.

jdwfly’s picture

I am running an already patched up version of simplenews, so I tried out the patch but it failed. Probably because my simplenews.module is already patched a couple of times. Anyway, I put the lines in manually where they are supposed to be and it works just like it should. Thanks

adam_b’s picture

Version: 6.x-1.0-rc6 » 6.x-1.x-dev
Status: Fixed » Needs work

I've upgraded to the dev edition, but although it's fixed !site, I'm still not seeing the values for !date and !login_uri.

I chucked in all the variables from the instructions below the Body field and the test email read:

[name] (the name of your website),
http://[domain]/ (a link to your homepage),
[domain]/ (homepage link without the http://),
!date (today's date),
!login_uri (link to login page),
http://[domain]/newsletter/confirm/add/f04e1b96c60t22
(subscription confirmation link),
http://[domain]/newsletter/confirm/remove/f04e1b96c60t22
(unsubscription link),
http://[domain]/node/187 (link to this newsletter issue),
[name] newsletter (name of this newsletter series)
portulaca’s picture

I had problems with !mailto and !site in subscription confirmation email, and I can confirm the dev version fixes it.

danny_joris’s picture

Same here as #21. The dev fixes this.

sutharsan’s picture

Status: Needs work » Fixed
StatusFileSize
new880 bytes

Attached patch fixes adam_b's bug in #20. Patch applied to dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.