mermberfix logo x
The MemberFix Team’s got you covered.
Membership plugins

Automatically Activate FreshDesk Accounts on ThriveCart Purchase

How to send an activation email from FreshDesk using Zapier

Introduction

If you’re using Freshdesk as your ticket management system you’ve probably notice an annoying quirk with user account activation.

It’s a manual process!

The only way to activate an account after it’s been created is to manually hit the button ‘Send activation email’.

That negatively affects your customer onboarding and wasted your time too.

So we found a way to automated it. 🙂

In this article you’ll learn how to send FreshDesk activation emails automatically using Zapier and some Python code.

 

What you will need

1 – Freshdesk

2 – Zapier with Pro plan to be able to run Paths

Setting up the Zapier automation

We manage the process of account creation in Freshdesk automatically when our customers subscribe for our services via ThriveCart.

This automation is handled by Zapier:

1 – Login to your Zapier account

2 – Create an automation selecting any event that you’d like to use as a trigger (in our case it is a ThriveCart purchase event)

3 – Create a new step and select FreshDesk as the application

4 – Choose Action Event – ‘Find Contact’

Freshdesk Zapier Python 1 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

You might want to ask why do we need this step if we are creating an account from scratch?

But the reason is that you might already have this account in your FreshDesk, so we have 3 following possible cases:

  1. Account does NOT exist in FreshDesk
  2. Account DOES exist in Freshdesk but it has not been activated yet
  3. Account DOES exist in FreshDesk and is active

We want to handle all of these cases and for this we will need the Pro plan from Zapier to be able to use their Paths feature.

5 – Choose your Freshdesk account in Zapier

6 – Fill up the Email field in the next step. You will need to take this information from your Trigger event:

Freshdesk Zapier Python 2 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

Test this step and if everything is ok then proceed to the next step

7 – Add another action selecting Paths from Zapier

8 – Initially you will have 2 Paths from the beginning, add one more as we need 3 Paths to run this automation.

Freshdesk Zapier Python 3 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

Case 1: Account does NOT exist in Freshdesk

9 – Edit Path A and select a name for this Path. In our case that would be ‘Doesn’t exist in Freshdesk’

10 – Setup a Rule selecting email from your Trigger event in  the first dropdown and condition ‘Does not exist’

Freshdesk Zapier Python 4 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

11 – Add a step to this Path selecting Freshdesk as an application and choose to ‘Create contact’ option

12 – Fill up the required fields which are ‘Name’ and ‘Email’ with the data from your Trigger event

Freshdesk Zapier Python 5 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

13 – Add one more step selecting Freshdesk as an application and choose ‘Find Contact’ option

At this point you might be curious why do we need this step again?

Because now when the account has been created we need to get its FreshDesk ID in order for our last step in this Path to work.

14 – Fill up the ‘Email’ field taking it from your Trigger event

15 – Add the last step to this Path selecting ‘Code by Zapier’ with Action event ‘Run Python’

16 – In ‘Customize Run Python’ select the following options:

  • Input Data: put a name here for your variable that we will be using in our code
  • Select a Freshdesk ID from your previous Zapier step

Freshdesk Zapier Python 6 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

Here is a code example below that we will be using:

fdid = input_data ['freshdeskID']
url = 'https://memberfix.freshdesk.com/api/v2/contacts/' + fdid + '/send_invite'
headers  = {'Authorization': 'Basic am9obi5kb2VAZ21haWwuY29tOnlvdXJwYXNzd29yZDEyMw=='}

r = requests.put(url, headers=headers)

17 – Before you proceed with editing the code there is one more step required, you need to encode your Freshdesk login credentials into Base64.

  • Go to https://www.base64encode.org/
  • Put your login credentials into the first field in the way: youremail@example.com:your_freshdesk_password

Freshdesk Zapier Python 7 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

  • Hit Encode button, you will receive your encoded credentials in the second field (keep the page open, you will need this data in the next step

Freshdesk Zapier Python 8 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

18 – Copy and paste the code above to ‘Code’ field and modify it according to the instructions below:

  • Replace ‘freshdeskID’ with the name that you selected in the previous step (keep the comas!)
  • Edit URL part replacing ‘memberfix’ with your Freshdesk URL( example: https://yourdomain.freshdesk.com/api/v2/contacts/)
  • Replace ‘am9obi5kb2VAZ21haWwuY29tOnlvdXJwYXNzd29yZDEyMw==’ with your encoded credentials from the previous step.

19 – Hit ‘Done editing’

Case 2: Account exists in FreshDesk but it is Inactive

20 – Go to the next Path, selecting it in the top left corner:

Freshdesk Zapier Python 9 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

21 – Rename it on your own desire, we’ll be using ‘Does not exist in FreshDesk Inactive’

22 – Repeat Step 10 selecting the email from your Trigger Event

23 – Hit ‘+AND’ button to create second condition and select ‘Active’ field from ‘Find Contact’ step, set (Boolean) is false for this condition:

Freshdesk Zapier Python 10 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

24 – Add a step ‘Code by Zapier’ and repeat Steps from 14 to 19

Case 3: Account does exist in FreshDesk and active

25 – Go to the last Path and name it according to your needs

26 – Setup the same rules as in Step 23 except that you choose (Boolean) is true for the second condition

Freshdesk Zapier Python 11 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

27 – Add a step ‘Email by Zapier’ an set Action event to ‘Send Outbound Email’

28 – Customize Outbound Email on your own

29 – Hit ‘Done editing’ and activate your Zap!

Congratulations! You have setup an automation to automatically activate accounts in FreshDesk!

Conclusion

Setting up this automation will allow you to save a lot of time on accounts activation freeing a time for more important things

Now let’s hear from you!

How are you managing your customer’s database?

Tell us your experience in the comments section below!

What do you think of this tutorial?

Article Title: Automatically update records in Airtable after Thrive purchase

Short Description: Tired to manage your customer's database manually? Let's automate this! Click here to read our comprehensive tutorial!

Author: Viktor Nadeyin

Publisher - Orgnization: MemberFix

Publisher Logo: mermberfix logo x200 1 - Automatically Activate FreshDesk Accounts on ThriveCart Purchase

User Review
5 (1 vote)

You may also enjoy...

WordPress based membership sites have certain requirements, and make use of certain applications that, in my experience, makes most of the popular hosting providers a poor choice.
Learn how to insert clean code in your WordPress posts without your single or double quotes being changed by WordPress.
How to fix “background request blocked” error while using WordFence security plugin in conjunction with OptimizePress
Learn how to check if the Schema rich snippets plugin for Wordpress is creating the correct “Structured data” that Google wants.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments