Use the first name of sender on Gmail

Hey there!

I would like to know if it's possible to put automatically the first name of the sender in my mail template?

for example:

Hello {{first_name}},

and that it will use the first name from his sender information:

You can use the {site} command to information from the site you are on:

In the case of Gmail you should be able to find the name of the author of the email you are replying to using the following CSS selector:

Hello {site: text; selector=.h7:last-child .gD},

Note the error message above about "No match" is because the example snippet naturally can't find the name when running in the community forums.

If you wanted just the first name, you could split the string on the spaces and take just the first item like so:

Hello {=split({site: text; selector=.h7:last-child .gD}, " ")[1]},


Cool stuff. I really need to learn more about these selectors.

How can I find a selector on another website by myself?

There are a number of resources available to help determine a CSS selector.

As background you might want to start with this overview of what CSS selectors are:

Here is a brief video of an approach to getting a selector using the tools built into Chrome:

Here are two different Chrome Extensions that can help you get a selector:

If you have any specific cases you need help with, feel free to post to these forums

1 Like

Is this possible for a new email (as opposed to a "reply?")

Hi @John_Gay,

With a little bit (ok ok, a LOT hehe) of help from @scott, here you go:

{strip_address=(txt) -> replaceregex(txt, "(.*$", ""); trim=yes}{fullname=trim(catch(strip_address({site: text; selector=.nH:focus-within .aDm}), catch(strip_address({site: text; selector=.h7:last-child .gD}), default)))}{=split(fullname, " ")[1]}

The last bit is what selects just the first name:
{=split(fullname, " ")[1]}

It's taking the contents of fullname, splitting them by spaces, and then giving you the first piece of the result. So if you were to change the number in the square brackets to 2, it would give you the second part.

Look at the example below:

{fullname="John Paul Jones"}
The first name is {=split(fullname, " ")[1]}
The second name is {=split(fullname, " ")[2]}
The last name is {=split(fullname, " ")[3]}

Cannot preview {site} commands

HI @biuro,

The {site} command won't preview in the forums, but if you copy that snippet into your dashboard and use it in gmail it will work correctly.

Take a look into the screenshots, Thanks

You won't see it in the dashboard preview either. That's only going to work when replying to an email in gmail. Try it when replying to an email in gmail.