I would like to be able to distinguish between comments and updates in the digest item body. So I would like to have the same variables available for a digest item as for other subscription items.

Comments

salvis’s picture

Unfortunately, because of the complex interaction with the mail_edit module (which is beyond my reach) this is very difficult...

gustav’s picture

I am sure you are right. But out of curiosity: what determines which variables for the items can be passed to the template and which ones can not?

salvis’s picture

The majority of the variables are advertised and populated through the mail_edit module, which does not kick in until the message is actually sent. The bodies that go into !bodies need to be pre-assembled before the message is sent, and thus they don't have those variables available to them.

This is a complex and confusing part of Subscriptions...

gustav’s picture

salvis, thanks a lot for trying to explain that to me. Very much appreciated. Where can I find the code that assembles the body items?

salvis’s picture

It's all in subscriptions_mail_cron() — look for
if ($digest)
and
if ($mails)

For the mechanism that sets the mail variables, search for mailvars...

salvis’s picture

Version: 5.x-2.0-beta9 » 5.x-2.0-beta10
Status: Active » Fixed

You need to delete the digest template rows from {mail_edit} and {subscriptions_mail_edit} in order to see the new digest template. You should now be able to use all variables except for !sender_* and !recipient_*.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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