Best answer

Reply to an email address within Order Confirmation Mail

  • 27 September 2022
  • 10 replies
  • 315 views

Userlevel 1
Badge

Hi there,

 

I am trying to create a Zap within Gmail to automate a sales process for my ecommerce shop. I have come this far:

 

  • The trigger looks up new emails within my inbox with a certain line of text in the subject - works just fine
  • Now for the action, I want a reply to the email. However, I do not want a reply to the sender address of the email, since it is simply an order confirmation, so the sender email will always be the same and won’t be the email of the customer that has purchased one of my items
  • Instead, within that email there is a link to that customer’s email (it says “Send them an email” and when I hover over that link I can actually see the customer’s email as a preview in the bottom left of the screen). I want the Zap to find that field within the email it looked up in the trigger section and use that email to reply to

Unfortuantely, I haven’t found the right field in the “To” (Send to) section of the action for that link or I do not know which of those fields refers to the “Send them an email” button. Can anybody help me out with this?

For easier understanding I have attached a screenshot of what the link within the email looks like.

 

Thank you for your answers in advance!

Friendly,
Mathias

icon

Best answer by LowRider 13 October 2022, 15:19

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

10 replies

Userlevel 7
Badge +8

Hi @LowRider , 

 

There can be several ways to do that. The first way that comes to mind is to use Zapier Email Parser as the Trigger instead of Gmail. To use the Parser you would need to setup auto forward in your gmail with the same rule of your current trigger. When you get the data into the parser we can take it from there. I THINK you would see the Hyperlink in this case and we can then use Formatter by Zapier to extract the email address from there. 

Userlevel 7
Badge +8

Afternoon @LowRider 😄, were you able to give @MohSwellam suggestion a go? 

Userlevel 2
Badge +1

@LowRider I use Python code to extract the email address from the Body HTML of the email: https://www.loom.com/share/fe9fb0185f1a49df89c7b97910b77101

 

If you share what a typical HTML Body is then I can share the python script to extract the email

Userlevel 1
Badge

Hey everybody, thank you for all the answers! I have been busy moving, so I didn’t find the time to try everything out yet.

 

I’ll keep you updated once I have made some progress.

 

Friendly,

Mathias

Userlevel 1
Badge

Hey there @tpretori , thank you so much for your effort with the video.

 

I have followed your steps and have copied the HTML body below:

 

<img style='position: absolute; opacity: 0; left: -9000px;' width='1' height='1' src='https://www.etsy.com/mailinglist/beacon/?campaign_label=epp_transaction_seller_notification_control&utm_source=transactional&utm_campaign=epp_transaction_seller_notification_control_010170_1070461468010_0_0&utm_medium=email&utm_content=&email_sent=1662997638&euid=IJDnUDwHKg-6QrH-_eCTeSJcPYUc&eaid=799598586924&x_eaid=8c0d4a563d'/>

<style>

div, p, a, li, td { -webkit-text-size-adjust:none; }

@media only screen and (max-device-width: 480px) {

* {-webkit-text-size-adjust: none;}

table[id=frame-body],

table[id=frame-top],

table[id=frame-bottom],

div[class=fifty50-left],

div[class=fifty50-right]

{ width: 100% !important; }

div[class=splitter]

{ clear:right; }

div[class=fifty50-right]

{ border-left: 0px; }

div[class=fifty50-right]

{ padding-top: 20px !important; }

td[class=fifty50-padding],

td[class=… (truncated)

 

The element of the “Send them an email” part looks like this when inspecting it:


<a href="mailto:EMAILADDRESS (The customer’s email address is here; I deleted it for privacy reasons)" style="text-decoration:none;color:#e55400" target="_blank">
            Send them an email
        </a>

 

I hope that helps with the Python code!

Friendly,
Mathias

Hey everybody, thank you for all the answers (truepaintballer)! I have been busy moving, so I didn’t find the time to try everything out yet.

 

I’ll keep you updated once I have made some progress.

 

Friendly,

Mathias

 

I wish these answer would be helpful for your try once and then let us know.

Userlevel 1
Badge

I have set up the workflow so far and everything works just fine; I just don’t know what Python code to use to extract the email address from the email.

 

Maybe someone can help with this?

Cheers

Userlevel 1
Badge

@MohSwellam I used Zaper Email Parser now to find a solution.

 

I basically built 2 different Zaps for this:

 

  1. The first Zap filters emails within Gmail according to the criteria I am looking for and then forwards those emails as an HTML body to the Zapier Parser mailbox. I then created a template in the Parser to find the email address within that HTML body
  2. The second Zap has “new email” as a trigger in the Zapier Email Parser. I then create the rest of the workflow from there and in the end I simply send an email via the Gmail account to the customer. The customer email is then provided by the Zapier Parser

 

Thanks to everyone for the help, works perfectly!
 

Cheers

Userlevel 2
Badge +1

@LowRider can you attach the html as a file?

 

What you pasted above got truncated.

 

I think the code below will work but I cannot test until the HTML file is shared or you can test and if there are issues then send me the HTML (do a search for the email address and redact it before sharing the file).

 

import re

html = input['html']

email = re.search('href="mailto:(.*?)"', html).group(1)

return {'email':email}

 

 

Userlevel 4
Badge +7

Hey @LowRider !

 

Glad to hear you got Parser working for you -- it is an excellent tool!

Thanks to everyone else for helping and suggesting solutions as well, much appreciated :wave: