Support

Home Forums Event Espresso Premium Email styles and template not changing.

Email styles and template not changing.

Posted: July 31, 2023 at 10:49 am

Viewing 5 reply threads


roodude

July 31, 2023 at 10:49 am

Hello. Just starting to get familiar with EE. I needed to use a href=”https://eventespresso.com/topic/ee4-custom-message-template-how-to-link-to-custom-css-file/#post-290277″>this method to add some simple styles to the Registration Approved emails. Here’s what I put in my functions file:


add_filter(
 'FHEE__EE_Messages_Template_Pack__get_variation',
 'ee_modify_email_variation',
 10,
 8 
);

function ee_modify_email_variation(
    $variation_path,
    $messenger,
    $message_type,
    $type,
    $variation,
    $file_extension,
    $url,
    EE_Messages_Template_Pack $template_pack
) {
    if ( $messenger != 'email' ) {
        return $variation_path;
    }
    return get_stylesheet_directory_uri() . '/ee-extra-styles.css';
}

Then in ee-extra-styles.css in my child theme, I added the following CSS as a test to make sure it was working correctly.

*{
border: 1px solid red; 
}

The next time I generated the email, it worked, and everything had a red border. Then, I removed the CSS and made some other changes, but every time I resend the email it still has red borders on everything, even though that CSS is no longer there.


Tony

  • Support Staff

July 31, 2023 at 1:24 pm

Hi there,

How are you resending the email?

What exactly are you clicking?

I’m asking as I suspect you’re resending the original message, not triggering a new message to regenerate with your changes.


roodude

July 31, 2023 at 2:02 pm

I was using the hamburger icon on the Registration list. When I click the button, it says “Messages queued for generation”, then I go to the messages tab and click “Generate and Send Now”.

It picked up my change the first time using that method, so I assumed it would continue to do so.

Here’s the order of events if that helps:

  1. Sent message normally by registering for the event with my email address.
  2. Decided some styling was necessary
  3. Implemented the filter in my previous change.
  4. Added custom CSS file with *{border:1px solid red;} to see if it picked it up.
  5. Regenerated email using the above method
  6. Border was applied correctly
  7. Edited CSS file to remove the border and saved, resent the message using the same method
  8. Border still there, despite being removed, border also showing up in the template editor.
  9. The only way to remove it was to comment out the filter that includes the file. If uncomment it, the border comes back, despite not being defined in the CSS. I even tried adding *{border:unset} and still no change.


Tony

  • Support Staff

August 2, 2023 at 7:11 am

I was using the hamburger icon on the Registration list. When I click the button, it says “Messages queued for generation”, then I go to the messages tab and click “Generate and Send Now”.

Thats generating and sending a previous message.

Go to The registration list table so you view the registrations for that specific event.

Then click to resend the messages:

https://monosnap.com/file/e8UUQobwIWEXcLgkCpY9xDd42BQGq8

That will re-trigger the message to generate.

Does it work then?

I’ve just tested your code and CSS, both with and without the border and its working as expected for me using the above.


roodude

August 2, 2023 at 9:21 am

Okay, I’m pretty sure I was doing it that way, but maybe I got turned around. I will try again and update this. While were at it, is this the absolute best way to edit email styling? Is there any kind of a visual interface for this?

If not, what’s the best way to add support for web fonts and make sweeping changes like that? Is it the same way you would do it on a normal webpage?


Tony

  • Support Staff

August 2, 2023 at 2:34 pm

There’s no visual interface for stles across multiple message templates no, each individual message template cant be edited and there is a visual element to that:

Event Espresso -> Messages -> Default Message Templates -> Registrations Approved -> Registrant for example.

However, I’m guessing that’s not really what you are looking for here.

It sounds like you need your own message template/variation:

https://github.com/eventespresso/event-espresso-core/blob/master/docs/E–Messages-System/overview-message-template-packs-variations.md

Viewing 5 reply threads

The support post ‘Email styles and template not changing.’ 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.

Event Espresso