PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Getting Post Image In Notification Email

  1. Hello,

    I am wondering if there is a way I can include a specific image or content from a custom field of a post in a notification email.

    Also can I include a background image in a notification email? I notice the editor keeps stripping the image out of my code.

    Posted 12 years ago on Thursday June 14, 2012 | Permalink
  2. I found this tutorial and was able to make it work for my first issue. http://www.gravityhelp.com/forums/topic/dynamically-populate-advanced-custom-field-instead-of-a-normal-custom-field

    Still wondering why it wont let me add a background image to the html email. I know some email providers wont get read it.

    Posted 12 years ago on Friday June 15, 2012 | Permalink
  3. David Peralty

    What code are you using in the HTML e-mail notification to add a background image?

    Posted 12 years ago on Friday June 15, 2012 | Permalink
  4. ('<table bgcolor="#8F6B47" background="http://massimo.andresthegiant.com/wp-content/uploads/2012/04/mainbg1.jpg" cellpadding="20" width="100%" height="100%" ><tr><td>')

    Like that

    Posted 12 years ago on Friday June 15, 2012 | Permalink
  5. mcombs
    Member

    Was there ever an answer to the background image issue in notification emails? It's stripping my code too.

    Posted 12 years ago on Wednesday July 18, 2012 | Permalink
  6. David Peralty

    Can you try single quotes instead of double quotes in your html to see if that works?

    <table bgcolor='#fff;'>

    instead of

    <table bgcolor="#fff">

    And see if it still strips it out?

    Posted 12 years ago on Wednesday July 18, 2012 | Permalink
  7. mcombs
    Member

    I've done it both ways and it ditches my code. Here is what I am doing:

    <td bgcolor="#FFFFFF" background="http://hammond-associates.com/wordpress1/wp-content/uploads/2012/07/Logo.jpg">

    or

    <td bgcolor='#FFFFFF' background='http://hammond-associates.com/wordpress1/wp-content/uploads/2012/07/Logo.jpg'>

    It keeps the bgcolor code with no problem either way. With the background image, it doesn't matter if I use single or double quotes ... when I switch between HTML and Visual view, it dumps it.

    Thanks for your help!

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  8. David Peralty

    If you just keep it on HTML view, add it in, and save, does it strip it out still? Visual view might not allow the background to stay, hence why it is stripping it out.

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  9. mcombs
    Member

    It does. I'm going to finish the rest of the code for the notification email and post it to PasteBin or wherever for you to see. I'll get that up later. Have a good evening!

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  10. David Peralty

    Great, that would be helpful, and give me time to find out why it might strip that out.

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  11. mcombs
    Member

    I got it. The key is to not toggle between visual and html so you keep your code. To get the background in the body of the email, I did this:

    <body style="background-image:url(http://hammond-associates.com/wordpress1/wp-content/uploads/2012/07/HA_Background_25.jpg)">

    And closed it at the end. Thanks for your help.

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  12. David Peralty

    Yeah, I was wondering about the visual editor stripping code. Glad you got it sorted.

    Posted 12 years ago on Thursday July 19, 2012 | Permalink