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,
I'd like to theme the outgoing notify email messages but, leave the messages viewed on the site the same. is there a way to separate the themes of each?
thanks.
Comments
Comment #1
sepehr.sadatifar CreditAttribution: sepehr.sadatifar commented@psychobyte I want to do the same, did you find any solution?
tnx
Comment #2
psychobyte CreditAttribution: psychobyte commentedNot yet. Kinda put this on the back burner for now. I'll definitely update this issue when I get more involved in it. Maybe in a month or so.
So far, the most promising techniques that I've found are here. I just havent' tried them yet.
https://www.drupal.org/node/1740550
http://stackoverflow.com/questions/7757284/how-to-apply-template-tpl-fil...
Comment #3
sepehr.sadatifar CreditAttribution: sepehr.sadatifar commented@psychobyte tnx for solutions.
I first tried to use 'theme_hook_suggestions' in 'hooK_preprocess_entity' but unfortunately this doesn't work for 'message' entities as mentioed in your first link.
this is how I managed to theme outgoing email:
defining two new themes in 'hook_theme'. one for starting html codes of mail (....) and one for closing tags (...).
using 'hook_entity _view_mode_alter' to alter 'message' entity which is about to be rendered before message notify sends the email:
the final version of this function has some codes to use Emogrifier module for converting a css file to inline styles (html emails only supports inline styles).
I hope this helps other ppl with the same problem.
Comment #4
bluegeek9 CreditAttribution: bluegeek9 as a volunteer commented