Support » Plugin: post2email » Add Media Images to Email?

  • Resolved Mike Price

    (@castroboy)


    WP Engine Tech Support

    Hey Mika

    Love your plugins and articles, I am a subscriber to HalfElf and read your stuff right away 🙂 Curious, is it possible to have the media images in the posts be sent via the email as well instead of just post content?

    if so, how can this be achieved. Any help or code you can provide that would accomplish this goal would be much appreciated. Hope you have a great Holiday season so far 🙂

    Mike
    http://CastroBoy.com

    http://wordpress.org/plugins/post2email/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    It MIGHT be possible if you treat the email as HTML email, which … I suppose one could do.

    I kind of hate HTML in emails, and now that Gmail is doing some weird caching, it’s going to break a lot of those.

    Still, the change would be here: http://plugins.trac.wordpress.org/browser/post2email/trunk/post2email.php#L88

    That’s stripping tags (I initially did it for security) but if you remove the strip_tags call it MIGHT work. Haven’t tested it obviously 🙂

    Mike Price

    (@castroboy)

    WP Engine Tech Support

    Thanks for the quick response, Mika! I will look into seeing where I would need to remove the “strip_tags” call and see if that works. No worries, I am testing this all on a non production site so if it doesn’t work, its not a big deal.

    I just have an image only post site that this would be awesome for (for review content purposes)

    Mike
    http://CastroBoy.com

    Mike Price

    (@castroboy)

    WP Engine Tech Support

    Hey Mika

    Sorry, I am not very great at coding like I wish I was. I couldn’t figure out how to remove the “strip_tags” from the plugin editor as I kept getting a “Fatal error” is it possible to assist me by maybe doing a paste bin so I can copy and paste into the plugin to get this to work? If you are too busy, I understand!

    Mike
    http://CastroBoy.com

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Mike, don’t sign your posts on these forums, it’s against the guidelines.

    You’d change the line to:

    $message = $page_data->post_content;

    But reading up on http://codex.wordpress.org/Function_Reference/wp_mail it looks like you’d ALSO have to change this line:

    http://plugins.trac.wordpress.org/browser/post2email/trunk/post2email.php#L97

    from

    wp_mail($to, $subject, $message, $headers );

    to this:

    add_filter( 'wp_mail_content_type', 'set_html_content_type' );
    wp_mail($to, $subject, $message, $headers );
    remove_filter( 'wp_mail_content_type', 'set_html_content_type' );

    What fun.

    Mike Price

    (@castroboy)

    WP Engine Tech Support

    Oops im so sorry! I wasn’t aware, I certainly would not have done it 🙂 Thanks so much for the help! I am gonna give this a shot. Thanks for being awesome

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add Media Images to Email?’ is closed to new replies.