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.
Hi there,
I'm trying to add a link to the newsletter post to the bottom of my email. In documentation it says:
Theme newsletter footer:
simplenews-newsletter-footer.tpl.php (for all newsletters)
Here's the code I have in simplenews-newsletter-footer.tpl.php in my theme folder:
<?php if ($format == 'html'): ?>
<p class="newsletter-footer">To post comments, <a href='[simplenews-newsletter-url]'>see this post online</a>.<br/><br/><a href="[simplenews-unsubscribe-url]"><?php print $unsubscribe_text ?></a></p>
<?php else: ?>
--
See this post online: [simplenews-newsletter-url]
<?php print $unsubscribe_text ?>: [simplenews-unsubscribe-url]
<?php endif ?>
<?php if ($key == 'test'): ?>
- - - <?php print $test_message ?> - - -
<?php endif ?>
The footer is not sent out with the newsletter test. I tried changing the filename to simplenews-footer.tpl.php with same results.
Am I missing something obvious here?
Thanks,
Andrey.
Comment | File | Size | Author |
---|---|---|---|
#16 | use_footer_in_hidden_categories.patch | 4.02 KB | Berdir |
#14 | simplenews_841966_hidden_footer.patch | 2.99 KB | Simon Georges |
Comments
Comment #1
miro_dietikerPlease provide more details
- Do you use a admin theme?
- Did you clear the theming cache after adding?
Additionally sending via cron might result in different results than test sending - depending base_url and admin_theme...
All of those are reasons that could trigger some issue. There are other issues in the tracker that each partially cover those topics.
Comment #2
mr.andrey CreditAttribution: mr.andrey commentedHi there,
I use the same theme for both admin and normal users.
I just cleared the cache* tables and rebuilt theme registry.
I tried both using the non-cron "test" to one email address, and the full cron mailing.
No footer.
Using "simplenews-newsletter-footer.tpl.php" in my zen-based theme folder (other non-simplenews tpl overrides work fine). The content type is default and titled "simplenews".
Andrey.
Comment #3
mr.andrey CreditAttribution: mr.andrey commentedAny other information that you need?
Comment #4
mr.andrey CreditAttribution: mr.andrey commentedFound the issue.
The following code in simplenews.module is problematic:
... because it disables the footer if the opt-in method is set to "Hidden". The footer may actually contain other information besides the unsubscribe variables (like the "test" newsletter message), so wouldn't it be better to just unset those variables rather than disable the footer tpl file altogether?
I'll try to work with the body tpl instead for my needs.
Best,
Andrey.
Comment #5
garyg CreditAttribution: garyg commentedThe first newsletter created will not include the footer any longer.
simplenews-newsletter-footer.tpl.php
All new newsletters I now create have no problem including the footer.
I have looked all day for something to fix but I can't find any problems.
Not using an admin theme. Learned to avoid that with simplenews.
I used to have the template module installed, but its turned off now.
I would just re-create the newsletter but I think it would throw off my news archives
that using that taxonomy term.
Simplenews 6.x-1.3
Any help here would be appreciated.
Comment #6
miro_dietikerUse 6.x-2.x.and report again.
:-)
Note that after an update to the current 6.x-2.x you need to clear the cache since we changed some theming signature in the footer.
Comment #7
garyg CreditAttribution: garyg commentedI updated to Simplenews 6.x-2.0-alpha1
I disabled simplenews template and register and kept simplenews roles
This did not resolve the missing footer (cache is cleared) in the main newletter
The footer continues to include just fine if it is sent using the newly created newsletter
Also the icons for sent, published and cron showed up at first but after the sending
completed for an issue (admin manual cron) the icons are now all missing.
Comment #8
roball CreditAttribution: roball commentedAs far as I know 6.x-2.0-alpha1 is broken and there has yet not been committed a fix for it .
Comment #9
miro_dietikerRoball, the broken part is just about reliability of sending process and send trigger.
That's nothing to do with footer and icons.
Please investigate and provide fixes for those new issues!
Comment #10
roball CreditAttribution: roball commentedI can confirm the problem mentioned in #4. If the Opt-in/out method of a newsletter is set to Hidden (at admin/content/simplenews/types/edit/[TID]), then no footer is never being sent out. Instead the module should just not generate any unsubscribe URLs, but still honour the footer template file (simplenews-newsletter-footer.tpl.php). It may contain other information such as copyright etc.
Comment #11
miro_dietikerroball
The rendering of the mail is identical to 6.x-1.x.
We didn't have enough resources to redefine the rendering for 6.x-2.x. So it is still by intention to supporess the footer completely in case of a hidden newsletter.
We should document this behaviour of the current release.
Instead i consider your preference as a feature request.
Comment #12
miro_dietikerneeds documentation then...
Comment #13
roball CreditAttribution: roball commentedYes, it's a feature request. Thanks for considering to document this behaviour more clearly.
Comment #14
Simon Georges CreditAttribution: Simon Georges commentedFirst attempt at a patch.
Comment #15
BerdirNoticed the same while fixing #1388948: Multiple Notices When Sending a Test Newsletter. Moving over to 7.x-1.x to have it fixed there first.
Comment #16
BerdirAttached is a patch for 7.x-1.x.
Patch contains also a few related refactorings.
The linked issue above already added tests to make sure that there is no unsubscribe link, so this is covered by tests..
Comment #17
BerdirComment #18
Berdirremoving needs documentation tag.
Comment #19
BerdirCommitted, back to 6.x-2.x.
Comment #20
BerdirComment #21
espurnesI get this messages when I send a newsletter to the test address. The theme is Omega but the
I'm using:
drupal 7.12
Mime Mail 7.x-1.0-alpha1
Simplenews 7.x-1.0-beta2
Omega - Responsive HTML5 Base Theme 7.x-3.1
Comment #22
michka CreditAttribution: michka commentedHi,
I have exactly the same problem !
Comment #23
BerdirThat has nothing to do with this issue, please open a new one.