React to Specific Sender Email on Gmail

Learn on how to do actions based on who sent you an email. In this example we'll reply automatically

  1. joaomgcd
    Sometimes you want to do something in Tasker when a specific person sends you an email. In this tutorial you'll learn how to do just that!

    In this example we'll automatically reply to Gmail messages that originate from just one specific email address.

    STEP 1 - INTERCEPT GMAIL NOTIFICATIONS


    • Create a new profile in Tasker
    • Add an AutoNotification Intercept event condition
    • Set the Apps to just the Gmail app
    • Enable the Has Reply Action option
    • Set Action Type to Created
    • Accept the profile and create an entry task


    STEP 2 - SHOW WHO SENT EMAIL


    • In the task add a Flash action with the text Received an email from %anpeople
    (i) For Gmail the %anpeople variable will contain mailto:senderaddress@gmail.com (obviously with a real email address there). Other apps may contain other stuff there. We need to get rid of the mailto: part and keep just the email address
    • Add a Variable Search and Replace action
    • Set Variable to %anpeople
    • Set Search to mailto:
    • Enable the Replace Matches option
    • Move the Variable Search and Replace action to the first position in the task
    (i) This will effectively remove the mailto: text from the %anpeople variable
    If you now receive an email on Gmail from someone you'll see a flash with their email address


    STEP 3 - REPLY IF IT'S FROM SPECIFIC SENDER


    • Add an If action with the condition %anpeople matches yoursender@gmail.com where the address is from the person you want to reply to
    • Add an Else action
    • Between the actions add an AutoNotification Reply action and set the Reply Text to Sorry, can't reply right now
    • Also add a Flash action just to confirm that this was done
    • Back out of Tasker to save


    Now if you receive an email from the sender you specified, AutoNotification will reply automatically :cool: