Needs work
Project:
Simplenews
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Oct 2012 at 16:05 UTC
Updated:
13 May 2020 at 03:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Stevel commentedThe attached patch changes the theme temporarily, so that while building the newsletter content, the theme from Mail System is used. This may also solve #1899092: Respect MailSystem theme setting for referenced content.
Comment #3
Stevel commentedpath_to_theme obviously doesn't give the theme name. Using $GLOBALS['theme'] now.
Comment #4
shaneonabike commentedI can confirm that this patch resolves my issues that were previously reported at #1876478: Simplenews not calling field theme functions. I tested it and it's working great!
Specifically, for my case all the custom code in my theme layer was never being called b/c it was using the admin theme template.php rather then the live site theme.
Comment #5
wucherpfennig commentedI applied the patch from above and it does not seem to work. It is only working properly when not using an admin theme.
Comment #6
Stevel commentedwucherpfennig: did you clear the cache after applying the patch? It's possible the page for anonymous users is still cached with the old theming applied.
Comment #7
wucherpfennig commentedyes, I tried that too... yesterday I almost lost my nerves because I finally got emogrifier (https://drupal.org/node/1336106) working and then this theme thing came up... luckily I am not in a hurry to set up a real newsletter project (just evaluating right now) because it seems to be almost impossible to find a working, reliable way sending newsletters with drupal...
Comment #8
shaneonabike commentedCould you expand on your comments? Or provide some debug stuff to help out ... it worked super well for me and I would love to get this rolled into the next release?
Comment #9
shaneonabike commented@wucherpfennig: bump
I kind of wonder if the reason that the admin theme won't work is due to access permissions. Specifically, anonymous users may not be able to use it if it's setup as the admin theme. What happens if you set your admin theme as default but not set as default admin theme.
Comment #10
shaneonabike commentedAlright the site I was working on started having this issue again. Then after (thinking about the comment above reported by someone else) I realized that perhaps it had to do with the overlay.
I disabled that in my user account and viola! It sent out the test emails properly again with all the appropriate theming.
Not sure how we can fix that in this patch but that might help others testing.
Comment #11
info@cgfix.com commentedthe patch no longer works and this is still a problem in the latest release. SimpleNews is a nice module but this is a problem for theming elements. this is also a problem when using the 'Simplenews Content Selection' Module when themeing the 'scs' view mode. I would suggest adding theme support in your module and not relying on the mail system. Currently, the Administration theme has to be set to what ever theme is needed for the mail to work or adding theme files to administration theme as well.
**** I found a simple solution ******
Since the problem exists due to simplenews using the theme active on the send page, I used the module ThemeKey to set my admin theme ( with admin theme under appearance set to default ) and set the theme of the page that sends the newsletter (node/#/simplenews) to the theme where the theme files are.
though, this may may not work with caching modules enabled such as boost (not tested yet)?
Comment #12
dreamer777 commentedare there any solutions so fur for current release:
I see this problem in two cases:
- sending email from admin page
- running cron on admin page
Changing both pages to deault theme with Page Theme module solves the problem. But it is a very dirty trick.
How to make Simplenews always use defaul theme?
Comment #13
bisonbleu commentedSorry if my post appears somewhat unrelated to this issue. But I too struggled quite a bit with Simplenews templates in order to create HTML emails.
In the end, the combination of the following worked great for me.
/sites/all/themes/your_theme/mail.cssComment #14
wylbur commentedComment indicates that this issue needs work so changing the status accordingly.
Comment #15
wylbur commented