Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can cognito sign-in verification email contain image?

I'm trying to figure out how to send cognito sign-in verification email:

  1. in the user preferred language
  2. in HTML with images (such as the company logo).

For the first one, I found this question and the answer suggests using Lambda triggers with custom attribute for language selection. The solution looks promising and I will definitely give it a try.

For the second one including image in email, I found base64 encoded images in email signatures which suggests two ways:

  1. embed image using data URI within the <img> tag
  2. embed image as attachment.

I tried (1) and it works for Thunderbird email client, but not for Gmail.

Is there a way to send cognito verification email with image?

like image 835
Bing Ren Avatar asked Dec 09 '18 22:12

Bing Ren


1 Answers

I see that you are looking to add your company logo in the Cognito sign-in verification email. I recently did the same thing. I tried to use base64 encoded image but the encoded value was pretty big and it's hard to maintain that.

However, the simpler way would be to store the image in online storage and use the image link for img src.

<a href='https://your_company_address.com'><img src="https://s3bucket_folder.s3.amazonaws.com/uploads/your_company_log.png" width= "40%" align= "center"/></a>

Hope it helps.

like image 51
Vishanth Avatar answered Oct 30 '22 02:10

Vishanth