• Resolved bolti95

    (@bolti95)


    When registering new users, I have a custom email template I’d like to use. I’ve replaced the welcome-email.php, with custom html which is all working fine apart from the images. Any suggestions to get these working? I’ve tried sending to Gmail and Microsoft email clients locally using only the template and the images show up okay so I know it’s just something in the wp code.

    To get the images to work I’ve tried:
    <img src="data:image/png;base64,<?php echo base64_encode(file_get_contents("/images/The image.png")); ?>" alt="Banner Image" width="auto" style="width:100%;max-width:484px; height: auto; max-height: 231.53px; display:block;" />

    And

    <img src="<?php echo get_template_directory_uri(); ?>/images/The image.png" alt="Banner Image" width="auto" style="width:100%;max-width:484px; height: auto; max-height: 231.53px; display:block;" />

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter bolti95

    (@bolti95)

    I also get Failed to load resource: the server responded with a status of 404 () error referencing the png on google dev tools

    @bolti95

    base64_encode is not a safe method, some email clients and email hosts may remove embedded images.

    Your second attempt is the best solution.

    Look at the email client’s message source to verify the received HTML and the image URL.

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @bolti95,

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. ??

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Image does not show on email’ is closed to new replies.