Parse Inbound Emails Zap
General Information¶
Wouldn’t it be great to have your incoming mail automatically processed and distributed to another application?
Imagine having all email sent to your “contact@” email be parsed and key information automatically added to Google sheets or have an announcement made in a Slack or Skype room.
Or when a candidate sends their resumes to your “jobs@” email, a profile for that candidate is automatically created in Workable or Breezy HR.
This is possible by creating a zap with Mailjet’s Parse Inbound Email. (If you haven’t read the “What is a zap” section, please do so now.)
Here’s how it works:
- Create a zap with the Mailjet trigger: Mailjet Parse Inbound Email.
- Mailjet will then generate a special email address (called a Parse API email address).
- You then redirect your inbound emails to this new parse email address (you have to do this outside of Zapier).
- Complete the zap by selecting what parts of the email you want to be parsed and sent into which Zapier connected app (Action).
And you are done – just start sending emails to your Parse API email address and let the zap do the work!
Let’s build a Parse Zap using Mailjet + Salesforce: A sales prospect fills out your sales contact form on your website and the email – with their key information in the email custom headers – will be transferred into Salesforce and create a new prospect.
Go to your Zapier account dashboard, and click on ‘Make a New Zap’.
Enter a name for your new Zap.
Trigger Phase¶
From the Choose a Trigger App search box, enter and select ‘Mailjet’.
Select the ‘Parse Inbound Email’ trigger and click on ‘Save + Continue’.
Select a Mailjet account to use, or connect a new one to Zapier. For reference click here.
At this point you will need to ask Mailjet to create a new parse email address for your Zap.
Although the long list of instructions on Zapier may look confusing, it is quite simple! :)
You can generate a parse email address using the Mac Command Terminal, Postman, Hurl.it or your favorite API Request Builder.
For this example, we will create the parse email address using Hurl.IT. (We have also provided instructions on creating a parse email address with Postman in Appendix A).
Open a new browser and go to www.Hurl.it.
From the drop down list, select ‘POST’. And paste in the Mailjet Parse Route URL: https://api.mailjet.com/v3/REST/parseroute
The Mailjet Parse Route URL will parse the inbound emails and send the contents to another location – in this case Zapier.
Click on the ‘+ Add Authentication’ link.
Add your Mailjet API Key (username) and Secret Key (password) into the respective text boxes. You can find this information on the API Key Management page in your Mailjet account.
Now you need to provide the destination URL, where the parsed email content should be sent. This URL is called a webhook URL.
Go back to your Zapier page and scroll to the bottom to find the webhook URL.
Click on the ‘Copy to clipboard’ button.
Go back to the Hurl.it page and select the ‘+Add Parameter(s)’ link.
In the name text box, enter: URL
And paste the webhook into the second text box.
Tick the checkbox to confirm you are not a robot ;) Then click on ‘Launch Request’.
Congratulations – you have made your first parse email address!
Note
Yes, the parse email address is quite long. Please record it somewhere for future reference.
Now you need to send a test email to your new parse email address to activate it. Please ensure the email contains the information needed to create a new Lead in Salesforce. (The minimum information needed by Salesforce to create a new Lead is company and last name).
Once you have sent the test email, switch back to your Zapier screen and click the ‘OK, I did this’ button.
You should see the ‘Test Successful!’ page with a link to view your parse inbound email (the test email you had sent a few minutes earlier).
If the test was not successful, use the ‘Re-test Mailjet’ button to get another parse email address, or send another test email to the parse email address.
Click on the ‘Continue’ button to complete the Parse Inbound Email Trigger!
Note
You will need to redirect emails sent from your ‘contact us’ form to your new Mailjet parse email address – with the key contact information stored in custom email headers. This step is done outside of Zapier and should be completed before you turn on your zap.
Action Phase¶
Now onto Step 2: create the Action – adding a contact prospect to Salesforce!
From the ‘Choose an Action App’ search box, enter ‘Salesforce’ and select it from the list.
You will see a list of possible Salesforce actions.
Select ‘Create a new lead’ and click on ‘Save + Continue’.
At this point, you will need to connect a Salesforce account to this zap. If you have already connected a Salesforce account with Zapier, it will show up on the list. Otherwise click on the ‘Connect a New Account’ button to add a new Salesforce account.
In the pop-up window, click on ‘Yes, continue’.
Enter your Salesforce information and select ‘Log in’.
Go back to your Zapier window and you will see a new ‘Salesforce Account #1’ account. If you wish to change this default name, just click on the pencil icon and enter a new name.
Select your Salesforce account then click on ‘Save + Continue’.
You will now see all the fields associated with a Salesforce Lead.
You need to match the information from your test email to the respective Salesforce fields.
Simply click on the drop-down list for the desired Salesforce field and match it to your email.
Once you have matched up all the fields, scroll to the bottom of the page and click on ‘Continue’.
The test page should say ‘Test Successful!’. If the test was unsuccessful, please use the ‘Re-test Salesforce to get another lead’ option.
Click on ‘Finish’.
And the last step – use the toggle option to turn on your Zap.
You are done! Your Zap is on and will automatically run when email is sent to your parse email address.