How to make the business logo icon appear in outlook message box

Asked

Viewed 1,072 times

4

I have an email trigger code using Zend.

$mailTransport = new Zend_Mail_Transport_Smtp($this->smtp_host, $config);

$mail = new Zend_Mail('UTF-8');
$mail->setFrom($from['email'], $from['name']);
$mail->addTo($to);
$mail->setSubject($subject);
$mail->setBodyHtml($bodyHtml);
$mail->send($mailTransport);

In the screenshot below, see that Meetup has an icon... when they send an email marketing. While most only have the initials, like the Free Market "ML". How could I customize this in my messages.

Is there an API for this?

inserir a descrição da imagem aqui

  • these avatars are set by the email provers and not by the email itself. which your email provider?

2 answers

4

First it may not work for all cases, so I tested and researched only for: inserir a descrição da imagem aqui

The concept is the same that appears here in Gmail. inserir a descrição da imagem aqui

Here the icone alone: inserir a descrição da imagem aqui

Short description

They are referred to internally as goomoji, and they appear to be a non-standard UTF-8 extension. When Gmail finds one of these characters, it is replaced by the corresponding icon. I couldn’t find any documentation on them, but I was able to reverse engineer the format.

So how does it work?

We know that somehow, 876Urg==means the icon 52E, but how?

If we decode Base64 876Urg==, we got 0xf3be94ae. This looks like the following in binary:

11110011 10111110 10010100 10101110

These bits are consistent with a 4-byte UTF-8 encoded character.

11110xxx 10xxxxxx 10xxxxxx 10xxxxxx

Thus, the relevant bits are the following .:

  011   111110   010100   101110

Or when aligned:

00001111 11100101 00101110

In hexadecimal, these bytes are the following:

FE52E

As you can see, with the exception of Feprefix which is presumably distinguishing goomojiicons from other UTF-8 characters, it corresponds 52Eto the URL icon. Some tests prove this is valid for other icons.

Looks like a lot of work, there’s a converter?

This, of course, can be routed. I created the following Python code for my test. These functions can convert the Base64 encoded sequence to and from the short hexadecimal string found in the URL. Note that this code is written for Python 3 and is not compatible with Python 2.

Conversion functions:

import base64

def goomoji_decode(code):
    #Base64 decode.
    binary = base64.b64decode(code)
    #UTF-8 decode.
    decoded = binary.decode('utf8')
    #Get the UTF-8 value.
    value = ord(decoded)
    #Hex encode, trim the 'FE' prefix, and uppercase.
    return format(value, 'x')[2:].upper()

def goomoji_encode(code):
    #Add the 'FE' prefix and decode.
    value = int('FE' + code, 16)
    #Convert to UTF-8 character.
    encoded = chr(value)
    #Encode UTF-8 to binary.
    binary = bytearray(encoded, 'utf8')
    #Base64 encode return end return a UTF-8 string. 
    return base64.b64encode(binary).decode('utf-8')

Examples:

print(goomoji_decode('876Urg=='))
print(goomoji_encode('52E'))

Exit:

52E
876Urg==

And of course, finding an icon’s URL simply requires creating a new draft in Gmail, inserting the desired icon and using the DOM inspector of your navigator.


References:

https://blog.mailchimp.com/how-we-set-up-emoji-support-for-subject-lines/

https://www.campaignmonitor.com/resources/guides/using-emojis-and-symbols-in-email-marketing/

https://stackoverflow.com/questions/28095387/animated-icon-in-email-subject

https://www.extendoffice.com/documents/outlook/4437-outlook-emoji-symbols-in-subject-line.html

https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs

  • Thanks for the effort! But I believe it’s something simpler. As @Wendelrodrigues said

1


As far as I know there it shows the image that is in the email account. ML should not appear because it probably does not have.

Try to insert a photo into the email account that is the sender of these messages.

  • Man, that was it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.