I've found this problem that when an email address is subscribe to multiple simplenews mailouts the same (first) template will be used in all e-mails that go through simplenews template.
The attached patch seems to fix the problem. It simply switches around the detection of the tid - prioritising the newsletter tid over the user's account tid.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wuekkie’s picture

call to undefined function on line 106 dsm($tid)

Wuekkie’s picture

Tried patching manually in my first post. Later tried patch.exe and got "Hunk #1 failed at 100" here is the reject file from patch.exe:

adam_b’s picture

subscribing... any news re this?

Mac Clemmens’s picture

Try changing dsm to drupal_set_message() and that should resolve the issue. dsm() is a function available through the devel module, which fails if not enabled. You can probably also just delete that line.

--- simplenews_template.module.orig 2010-01-12 16:43:35.000000000 +0000
+++ simplenews_template.module 2010-01-12 16:50:25.000000000 +0000
@@ -100,12 +100,11 @@
*/
function _simplenews_template_mail_alter_simplenews_node(&$message) {
// Setup newsletter data
- $tid = reset($message['params']['context']['account']->tids);
- if (!empty($message['params']['context']['account']->tids)) {
- $tid = reset($message['params']['context']['account']->tids);
- } else {
$tid = $message['params']['context']['newsletter']->tid;
+ if (!$tid) {
+ $tid = reset($message['params']['context']['account']->tids);
}
$newsletter = taxonomy_get_term($tid);
$node = $message['params']['context']['node'];
$content = $message['body']['body'];

ikeigenwijs’s picture

subscribe to

ikeigenwijs’s picture

patch of nr 4 seemed to work.

i did not do this: Try changing dsm to drupal_set_message() and that should resolve the issue. dsm() is a function available through the devel module, which fails if not enabled. You can probably also just delete that line.

Experiencing problems with images in the head and footer, not displaying referenced as :
cid:cc512de8bb1bbd868a16bdf60922accf@www.revaki.ugent.be

on the image front the
extra dsm($tid);
made no difference

franz’s picture

Status: Needs review » Fixed

The code changed up to now, please check if there is need to reroll the patch and reopen the issue if it's still active

Status: Fixed » Closed (fixed)

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

lavamind’s picture

Status: Closed (fixed) » Active
FileSize
660 bytes

This bug is still present in latest 6.x-1.x release (May 10 2010). If one email has multiple subscriptions to newsletters using templates, the template from the lowest-tid newsletter is used.

The code from the reporter's patch seems to work. I re-rolled the patch using the latest 6.x-1.x code and without the devel function call.

franz’s picture

Status: Active » Fixed

Commited, thanks!

Status: Fixed » Closed (fixed)

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