Reviewed & tested by the community
Project:
Simplenews Template
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Nov 2009 at 18:06 UTC
Updated:
16 Jan 2012 at 10:35 UTC
Jump to comment: Most recent file
Comments
Comment #1
artatac commentedAlso affected by this please advise thanks
Comment #2
gdoteof commentedSo after screwing around with the theme functions I am 99% sure simplenews_template is actually just doing nothing to the emails. No amount of messing with the theme functions (which seem to have replaced the tpl.php files) has any effect on the emails being sent out by simple news
Comment #3
artatac commentedI have had some success > install simplenews_template then go to admin/content/simplenews/types/edit/xx > go to the Style section > css at the bottom and put in stuff like below
regards
Joe
Comment #4
gdoteof commentedI think I fixed this for my own purposes at least.
A couple things were happening. $tid was not being found correctly sometimes, so sometimes we weren't aware of which newsletter we were on. I am not sure if I am correctly extracting the proper term, it seems looping through all of them may be a waste.
The other thing was the simplenews_template_mail theme function was not getting called because it was inside of a if (is_null($message['body']), so it would only be templated when it was empty??
Also, the documentation just needs to be updated. Themes are now done in functions instead of tpl files apparently.
Your theme can implement theme_simplenews_template_mail and theme_simplenews_template_content
I just took the ones out of the simplenews_template module and slightly altered.
Comment #5
zilverdistel commentedI did not apply the patch entirely, only the following part:
- if (is_null($message['body'])) {
+ if (!is_null($message['body'])) {
That solved the problem for me (theme functions not being overridden)
Comment #6
dooug commentedI was also trying to write my own override for the theme_simplenews_template_mail function and discovered it was not being called.
I found the descriptions of the themeable functions to be very deceiving:
At first I though the *_content function would theme the node on the site and the *_mail function would theme the node when emailed. However, now I am under the understanding that the _content function themes the content of the node and the the _mail function puts HTML wrappers around that output when it is mailed.
Also, I was confused by the documentation instructing to use the simplenews_template.tpl.php while there is no such file. Is that file supposed to be available to theme the simplenews nodes on the site?
For clarity, I have changed this title to be more appropriate for the patch that needs review above, and the issue of the missing simplenews_template.tpl.php file should be discussed at #684836: D6.x version has no simplenews_template.tpl.php file..
Comment #7
mbarcelo commentedAlso affected by this.
Comment #8
codevoice commentedSubscribing, neither #3 nor #5 worked for me.
Comment #9
muschpusch commentedThe new dev release fixes this part of the patch:
- if (is_null($message['body'])) {
+ if (!is_null($message['body'])) {
The other parts are still needed when working with simplenews 6.x-2.x-dev. I attached a new patch. Please review & test!
Comment #10
TimG1 commentedSubscribing...
I'd love to test, but I have no idea where/how to start/test.
Can anyone provide an example on how to use this function?
function theme_simplenews_template_content($newsletter_name, $issue_title, $header, $issue_body, $footer) {Where does this function go? In template.php? Do I create a new file called simplenews_template.php and put it in there? Once I have it in the correct file, how do I use it?
Thanks for reading,
-Tim
Comment #11
gdoteof commentedTim, you make a function in your template.php called
THE_NAME_OF_A_THEME_simplenews_template_content(...)
basically you are replaceing the 'theme' in 'theme_simplenews..' with the name of your actual theme.
moving to major, because apparently it's not critical
Comment #12
mustanggb commentedIt's also fixed in latest dev
Comment #14
igorik commentedlast commit for 6,x dev is still from July 11, 2010 - 08:07
so this is not fixed
Comment #15
ronalddevos commentedAlso affected by this
Comment #16
muschpusch commentedok switched the status... No idea why it isn't commited... Just use the patch in the meanwhile...
Comment #17
remco75 commentedAny progress on this: is there gonna be an new version soon? Would be great not having to patch