Home Forums Newsletter Plugin Support Filter or Action to use to replace image in newsletter?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #354631
    James LeDoux
    Participant

    Is there a Filter or Action that could be used to replace image in newsletter? Looking at the filters and actions listed here, I don’t see a way to do it.

    The reason we’d like to do it is that not all our posts have featured images. In the case of certain authors or categories for posts, we’d like to hook in and replace the blank image with the author avatar.

    #354632
    James LeDoux
    Participant

    Testing, I tried this in our child theme functions.php:

    add_filter('newsletter_message', function($message, $email, $user) {
    error_log('HT TNP: message->body length=' . strlen($message->body));
    return $message;
    }, 1, 3);

    But nothing was logged. However, if I use:

    add_filter('newsletter_message', function($message, $email, $user) {
    error_log('HT TNP: newsletter_message fired');
    return $message;
    }, 1, 3);

    It does log. But any code I try that uses ‘$message->body’ does not work, and does not log anything.

    These tests were made sending a real newsletter to a single subscriber, not the test email.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.