Support » Plugin: Notification - Custom Notifications and Alerts for WordPress » Inline CSS doesnt work. Any solutions?

  • Resolved birol089

    (@birol089)


    Hi,

    first of all, you have created a very usefully plugin. Thanks for that! I would recommend it anytime.

    I am creating a wp-site that should receive user generated content. I use a part of bbPress for user-profile management.
    I am using your plugin to notify user if their post receive us, if their post are accepted and/or if their post are aborted/deleted. Until now, its working perfect.

    I am beginner at development-languages.

    Now to my question.
    I have styled the notifications over the editor in wp with following method, wich working well.

    example:

    <div class="example" style="margin-top: -5px; color: #252525; font-size: 16px; line-height: 25px;">
    <p>Example text</p>

    But gmail and other big mail services ignores style commands. their accept the following method:

    example:

    <html>
      <head>
        <style>
          .example {
            margin-top: -5px;
          }
          #body {
            font-size: 14px;
        </style>
      </head>
      <body>
        <div id='body'>
          <p>....</p>
          </div>
      </body>
    </html>

    but if i use

    { }

    your plugin skip this.

    I have search the “Template”-files in your plugin to hardcoding this, but i dont find it 🙂 – is this in generall possible? if not, can you provide me a another solution?

    thanks in advance
    greetings
    birol

Viewing 1 replies (of 1 total)
  • Plugin Author Kuba Mikita

    (@kubitomakita)

    Hi Birol!

    That’s interesting. You say that if you style the merge tag with inline styles it’s stripped?

    I mean something like this:

    <span style="margin-top: -5px; color: #252525; font-size: 16px; line-height: 25px;">{your_merge_tag}</span>

    I think it should work with the WP, Notification shouldn’t skip the styles. But I’m not sure if Gmail or other email client will.

    Generally it’s not possible to hardcode the styles in the template, but using the filter might be an idea. Depends on your needs 🙂

    Please check this filter: https://github.com/Kubitomakita/Notification/blob/dev/inc/Notification.php#L209 or the one before.

    Filters reference.

Viewing 1 replies (of 1 total)
  • The topic ‘Inline CSS doesnt work. Any solutions?’ is closed to new replies.