Support

Home Forums Event Espresso Premium Adding your own styles in head of the Email Templates

Adding your own styles in head of the Email Templates

Posted: October 16, 2017 at 3:53 pm


figtree

October 16, 2017 at 3:53 pm

Hi There.

Im try to modify the styling of email messages a bit. How would I complete this?

Im trying to add some styles to the head section of the email templates.

Im guesting there is a email.css file somewhere or a head template?

Thanks


figtree

October 16, 2017 at 3:58 pm

Also is there a way for the user transaction on Paypal to skip not approved and go straight to approved? Saving the client approving the ticket.

We also have a invoice gateway that needs to show pending payment.


Tony

  • Support Staff

October 17, 2017 at 2:52 am

Im try to modify the styling of email messages a bit. How would I complete this?

Can Ia ask what you would like to change?

There are hooks available within the messages system which you can use to add your own styles (See HERE) but you may be better adding the styles inline within the template, it depends on what you want to change.

Another option is to create your own template ‘variation’ (the CSS used within the template), we have some documentation on doing so here:

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

Im guesting there is a email.css file somewhere or a head template?

Please do not modify core files, we have numerous hooks throughout EE so editing the files themselves is usually unnecessary.

Also is there a way for the user transaction on Paypal to skip not approved and go straight to approved? Saving the client approving the ticket.

Can you provide more details on this, please? Where is the client approving the ticket?

It sounds like you have the Default Registration Status set to ‘Not Approved’ on the event, so then the admin needs to set the registration to Pending Payment or Approved to allow payment but it is not really clear from the above.

We also have a invoice gateway that needs to show pending payment.

Then you need to set the Default Registration Status on the event to ‘Pending Payment’.

If you edit the event and look at this setting – http://take.ms/UGECC

What is it currently set to?


figtree

October 17, 2017 at 3:28 am

Hi,

I want to add some media queries to the email template for mobile devices. How would you complete the hook for this?

The status is set to pending payment. This work fine for The invoice gateway but what happens when someone pays by PayPal?

Thanks


Tony

  • Support Staff

October 17, 2017 at 3:35 am

I want to add some media queries to the email template for mobile devices. How would you complete the hook for this?

If you are not comfortable using hooks you could add those to the main body of the template.

The status is set to pending payment. This work fine for The invoice gateway but what happens when someone pays by PayPal?

When a full payment is made the registrations will automatically be updated to Approved.


figtree

October 17, 2017 at 4:13 pm

You cant add <style> tags to the main body. They need to be in the head. Its not that i’m not comfortable using hooks. I just need some more help. As the page you redirect be to just give you the cod. It doesn’t explain what it does or how it works or how you install it. I have use hooks before in WooCommerce.


Tony

  • Support Staff

October 18, 2017 at 2:27 am

OK, the thread I linked to lists multiple actions and shows the variables passed to those actions.

The action name explains where that action runs, for example:

do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_head', $message_type, $subject, $from, $main_body );

Is fired within the Email Messager, template head tag so I’m assuming you would use that.

$message_type holds the current message type, if you wanted the styles for specific message types you can check the content of that variable

$subject is the subject line.

$from is the from address.

$main_body is the content displayed within <body>.

So if you wanted to output styles for all message types you can do something like this:

https://gist.github.com/Pebblo/6376cad2620d74cd40b826749eec2aa0

You can add that to a Custom Functions Plugin on your site to load the function.

The support post ‘Adding your own styles in head of the Email Templates’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 2 years, 5 months ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!