matcornic / hermes

Golang package that generates clean, responsive HTML e-mails for sending transactional mail

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CID Embedded Images

TudorHulban opened this issue · comments

hi,
is it possible to use the library with content - id images and refer them in the HTML?
i understood the library targets more buttons, but for different client campaigns i should not be having the logo images in an external server, therefore the images need to be sent with the email .

thank you

Hello @TudorHulban , you can put a base64 image as a string for logo property inside hermes.Product

Example:

// Some tools exist to convert your image to base64
const logo = "data:image/png;base64,iVBORw0KGgoAAAAXXX[...]"
hermesConfig = hermes.Hermes{
  Theme: new(hermes.Flat),
  Product: hermes.Product{
    Name:      "MyProduct",
    Logo:      logo,
    Copyright: "Copyright © 2019 MyProduct. All rights reserved.",
  },
}

if need add a feature to support add local image file to inline use mime about cid tech rather than base64, because now base64 in outlook2016 show not correct. in different outlook 2016 client , logo image show not same.some client correct, some client can not find image to show.