How to modify the CSS for notification emails

Created by Phil Kurth, Modified on Mon, 27 Jun 2022 at 03:01 PM by Phil Kurth

You may use the af/form/email/styles filter to modify the CSS the is used to style email notifications. The following example demonstrates how to change the width of a table element within the email:

function alter_form_email_css_example( $css ) {
  ob_start();
  ?>
  table {
    width: 1000px;
  }
  <?php
  $new_css = ob_get_clean();

  return $css . $new_css;
}

add_filter( 'af/form/email/styles/key=FORM_KEY', 'alter_form_email_css_example' );

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article