hey everyone,

i'm actually becoming desperate while trying to send a digest to news which are put together by category. Everything i came up to so far was a SYNTAX_ERROR

The digest should look approximately like this:

Category 1
News 1 (Category 1)
News 2 (Category 1)
News 3 (Category 1)

Category 2
News 1 (Category 2)
News 2 (Category 2)
News 3 (Category 2)

Category 3
News 1 (Category 3)
News 2 (Category 3)
News 3 (Category 3)

Does anyone know what to do?

Comments

karing’s picture

How exactly are you going about configuring/coding things to try and make it send out such notifications and what syntax error do you get?

dark_underground’s picture

The error which i get in the template preview looks like this:
{SYNTAX_ERROR}

I've set on a few taxonomy-categorys which can be subscribed by users as a newsletter. Momentary i am using the templates which are brought as a standard by the module. Although as it comes the standardized digest template is putting all the new notes completely unstructured together, i'd like to subdivide the newsletter-digest issue as shown earlier. Quite honestly, my lack of experience with the module-syntax makes it pretty hard for me to follow up to how the syntax has to be set and enlarged by some parameters (tokens) (i also don't know how they have to be put together in the syntax) to reach my wished function. Therefore i could really use some help to make the newsletter look structured and - of course - good.

salvis’s picture

I don't think this can be done presently.

Your first step would be to send a digest that lists only the categories, like

Category 1
Category 2
Category 3

The problem is, if you have ten notifications, there is no way to distill these down to three terms.

We might be able to implement something like [subs:terms] that has a list of unique terms and even [subs:terms:?:items], but if an item has two terms, it would appear twice.

karing’s picture

Ah - I see what you're trying to do. That would be neat - to make it a well structured/formatted newsletter. I've never thought about using subscriptions module that way. I just use it for quick updates (w/ cron running very often). But yeah it would be neat if those who opt to get the digest version get something that looks more like a Newsletter. subs:terms would be needed to give it the structure - but to make it look really nice - you'll likely want to be able to do HTML Email and I don't think Mail Editor can do this - or am I mistaken?

salvis’s picture

to make it look really nice - you'll likely want to be able to do HTML Email and I don't think Mail Editor can do this - or am I mistaken?

The Drupal mail system expects HTML as input, and that's what we give to it. It passes our input through drupal_html_to_text() (and so do we for the default Preview).

You can put HTML into your template, and drupal_html_to_text() will do its best to render it as plain text. However, you can install a third-party contrib that provides a mail system which will keep the HTML as HTML and add the required mail headers to actually turn it into an HTML mail message.

Mail Editor supports this by letting you change the preview mode so that you can see what is passed to the mail system, but that's where it ends.

We've briefly touched the HTML Mail module in #1402222: Blank email subject and body with HTML Mail module. There's also the Mime Mail module, but I recommend to not use that unless you're ready to pay the maintainer for lifting her finger.

I've specifically asked for feedback from people trying to send HTML email in #1172646-7: Subscriptions for D7 and following, but there has not been any response.

dark_underground’s picture

Title: how to put a digest in a digest? » how can i put a digest in a digest?

Thanks for the helpful replies.

HTML works perfektly within the subscription mail templates. Also the mails can be structured very well.

I'm using the mime mail module because with that i am able to send out mails which contain all of the pictures and which are therefore independent from the sending server.

I see, interlacing the templates is tricky, so i have to manage that on my own, right?
Salvis, thanks for these tokens you've posted. They will definetly be of great use for me.

Although i've still got one tiny problem: despite of translating the taxonomy the subscriber gets a mail containing nodes in every language and not only the language which it is supposed to (according to which one is set in the profile).
Every node, also the news, is being applied in every language by the i18n module.

Is there a way to filter the nodes correspondingly in the mail templates?

salvis’s picture

I see, interlacing the templates is tricky, so i have to manage that on my own, right?

Yes, I guess so. I don't have any brilliant idea on how to do this right now...

Although i've still got one tiny problem: despite of translating the taxonomy the subscriber gets a mail containing nodes in every language and not only the language which it is supposed to (according to which one is set in the profile).
Every node, also the news, is being applied in every language by the i18n module.

I wonder why (and how!) this happens. Please create a new issue and describe the steps to reproduce this situation, so that we can investigate.

P.S. We have 1.0 now, you should not be using beta3 anymore.

salvis’s picture

Issue summary: View changes
Status: Active » Closed (outdated)