Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Simon Georges CreditAttribution: Simon Georges commentedJust 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.
Comment #2
Simon Georges CreditAttribution: Simon Georges commentedMoving all feature request to 7.x.
Comment #3
miro_dietikerAgree 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.
Comment #4
BerdirThis 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?
Comment #5
Lukas von BlarerHow 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.
Comment #6
BerdirSee #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?
Comment #7
Lukas von BlarerOk, but how do I get this object in theme_preprocess_mimemail_message()?
Because I want to have a global HTML wrapper around my emails.
Comment #8
BerdirOh 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.
Comment #9
Lukas von BlarerDidn'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...
Comment #10
BerdirNot 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.
Comment #11
Lukas von BlarerSorry, 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?
Comment #12
BerdirWell, 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.