Posted: September 19, 2017 at 8:06 am
I am struggling with generating and styling custom emails. I have followed https://github.com/eventespresso/event-espresso-core/blob/master/docs/E–Messages-System/registering-message-template-variations.md and the other supporting documents. I have created a class and plugin as per instructions. I have created a plugin folder “eea-new-templates” uploaded “ee-new-messages-template-pack-sogt.php” to that folder. Added a folder “variations”. See below:
have created a class “EE_Messages_Template_Pack_New_Template_Pack_Sogt”
added arrays for all default templates. 1) where do I put the class file? Thank you, love the plugin! |
|
Hi there, You put all of your custom code within its own plugin. We have some documentation that outlines how to start with a blank plugin here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ If all you’re doing is adding a header and a footer, then you may not need to copy any templates. If you take a look in email_main_wrapper.template.php you’ll find action hooks before and after the main body of the email, which can be used to add a header and a footer. Any callback functions that hook into those action hooks can also be added to your plugin. One thing to keep in mind is after you’ve activated your plugin you may need to switch to the variation and reset the message template in the message editor for the new templates to take affect. |
|
Thanks for the quick response. I’ve built a few plugins for EE already, I am just confused about the instructions on https://github.com/eventespresso/event-espresso-core/blob/master/docs/E–Messages-System/registering-message-template-packs.md. So in that explanation Step One: Setup the Template Pack class code, the variations code and Step Three: Register your new template pack code should all be in the plugin?. What about the css? Thanks for your help. |
|
Yes all of your custom code should be put into the plugin. |
|
The support post ‘CSS for Custom Email Messages’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.