Usually a newsletter includes a link titled "Click here if you can't read this message correctly".
This is just a link to the node, and it would be useful to include it in every newsletter.

Comments

Simon Georges’s picture

Version: 6.x-2.0-alpha1 » 6.x-2.x-dev

Just changing the version which this issue applies to.
Nice idea, It already can be achived through theming, but helping by adding this to simplenews_footer (or a new simplenews_header ?) could be nice.

Simon Georges’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev

Moving all feature request to 7.x.

miro_dietiker’s picture

Priority: Normal » Minor

Agree this might improve our usability.

However the current hard work is not touching the rendering/theming layer and this feature is not subject of the current feature cycle.
There's a lot to do to improve the rendering / theming and improve the multipart mimemail support.

Berdir’s picture

This should be possible using tokens, something along the lines of <a href="[node:url]">Click here if you can't read this newsletter</a> anywhere in the content, body/footer template should work.

Therefore, and since this is only necessary for html mails, I'd say we shouldn't add this by default. Can we add clear documentation for this somewhere instead, e.g. the README.txt or here on d.o?

Lukas von Blarer’s picture

How would I do that outside the Simplenews template in the Mime Mail template? There is no token replacement and I do not have any information about the node being sent in the theme_preprocess_mimemail_message() function (is this intended behavior?). How could I accomplish that? I have got the same problem with the unsubscribe link. I want to have that inside the Mime Mail template as well.

Berdir’s picture

See #1403924-6: Change simplenews template to use new simplenews API. for how html mail currently does it. For the unsubscribe, you can do the same thing as we're doing in http://api.worldempire.ch/api/simplenews/includes--simplenews.source.inc.... Note that this is the same object as $params['simplenews_source'] in the patch.

Not sure why you need to do that in the mimemail template though, why are our newsletter body/footer templates not enough?

Lukas von Blarer’s picture

Ok, but how do I get this object in theme_preprocess_mimemail_message()?

Because I want to have a global HTML wrapper around my emails.

Berdir’s picture

Oh well, looks like you don't, mimemail doesn't pass the $message/$params array to the theme function.

My recommendation would be to override the footer template with an empty template, then you have complete control over the whole mail body in the body template, that's what we usually do.

Lukas von Blarer’s picture

Status: Active » Closed (fixed)

Didn't you mean to tell me to overwrite the mimemail-message.tpl.php with an empty template? This would work. It's quite ugly though.

I'll post stuff like that in #1122910: Compare HTML Mail with Mime Mail...

Berdir’s picture

Status: Closed (fixed) » Active

Not fixed as you hijacked an existing issue ;)

If you can provide documentation on how to add such a link (e.g. as a patch for the README.txt or a documentation page on d.o) then we can fix it.

Edit: If you have a default mimemail message template, then you'd need to override that as well yes. What I meant is overriding our footer if you e.g. want to place the unsubscribe link somewhere within the body and not just append it.

Lukas von Blarer’s picture

Sorry, I will try to do that :)

My problem is that I want to have those two links not in the body but in the mimemail-message.tpl.php. But you pointed me in the right direction. Maybe we could set up example Mime Mail templates?

Berdir’s picture

Well, it's much more complicated (= impossible right now) to do it in mimemail message templates. If you need it there, you need to open a feature request there and ask to pass $message and $params into the theme as well.

In our templates, you just need to add a link with the token.