how do y'all recommend sending images?
# ask-a-descoper
c
how do y'all recommend sending images?
s
Hey @colossal-appointment-48082 this is actually occurring due to most email frontends blocking base64 encoded images. You can read about it here: https://mailtrap.io/blog/embedding-images-in-html-email-have-the-rules-changed/#Inline-embedding-or-base64-images-in-emails Also referenced on item 2 here: https://sendgrid.com/blog/embedding-images-emails-facts/ I tested with apple email client and what you have does work. Gmail doesn't. An option would be to use your logo hosted on your website, like this:
Copy code
<img
                      src="<https://www.dopt.com/_next/static/media/logo-horizontal-dark-TDSRYT7E.98e51c4f.svg>"
                      width="89"
                      height="24"
                      alt="Dopt logo"
                      title="Dopt"
                      style="display: block"
                    />
However... it looks like that fails in gmail as well. ... This is also referenced on section 3 of the above sendgrid guide. @dazzling-oyster-96577 any ideas? We can't do it with an attachment currently right? FR for adding a logo to messages? @important-microphone-85224 FYI.
c
ohhh very interesting! I didn't realize it was the email frontend's doing the removal. I still am curious if y'all have a suggestion that works across clients!
s
I'll open an FR to attach an image to the emails. Then the option 1 on the sendgrid guide should work.
c
silly question. what does FR mean? but okay! sounds good so we will continue without images for a bit then add them later with method 1?
d
FR stands for Feature Request. Looking into this for you @colossal-appointment-48082 to see if there's another way. I'm thinking you can upload the image to a server and then include it in your email as a link, that's one way to get around the base64 encoding support issue.
👍 1
c
oh isn't that not supported in gmail?
An option would be to use your logo hosted on your website, like this:
``` <img
src="https://www.dopt.com/_next/static/media/logo-horizontal-dark-TDSRYT7E.98e51c4f.svg"
width="89"
height="24"
alt="Dopt logo"
title="Dopt"
style="display: block"
/>```
However... it looks like that fails in gmail as well. ... This is also referenced on section 3 of the above sendgrid guide.
d
Ah I see, so <img> tags fail as well with the URL huh? Interesting... have you tried attaching the photo to the email and then using the CID (Content-ID) to reference the image instead of a URL?
<img src="cid:your_image_cid" alt="Your image">
I guess it's listed as the first option in the Sendgrid blog @salmon-night-88354 provided
c
oh we can't do that with the connector though right?
unless i'm missing something
s
Right. Currently, it's not possible to use an attachment like that.
@colossal-appointment-48082 Guy pointed something out. Do you have a published logo that's not an svg somewhere? This works. I found a random dopt image that wasn't an svg.
Copy code
<img
                      src="<https://media.licdn.com/dms/image/C560BAQEWdHIQJEmXRw/company-logo_200_200/0/1662597253624?e=2147483647&v=beta&t=7ez5242bJ38rLBxbLFsGo0DdxJii4xF-PBsRLaLN3Ug>"
                      width="89"
                      height="24"
                      alt="Dopt logo"
                      title="Dopt"
                      style="display: block"
                    />
c
let me give this a shot!
oh it worked!! thanks a bunch!
s
Nice!
NP
🙌 1