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 Send FreshDesk Activation Email On Signup

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 Send FreshDesk Activation Email On Signup

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 Send FreshDesk Activation Email On Signup

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 Send FreshDesk Activation Email On Signup

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 Send FreshDesk Activation Email On Signup

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 Send FreshDesk Activation Email On Signup

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

CODE

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: [email protected]:your_freshdesk_password

Freshdesk Zapier Python 7 - Automatically Send FreshDesk Activation Email On Signup

  • 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 Send FreshDesk Activation Email On Signup

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 Send FreshDesk Activation Email On Signup

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 Send FreshDesk Activation Email On Signup

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 Send FreshDesk Activation Email On Signup

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

t

Now let’s hear from you!

How are you managing Freshdesk accounts activation?

Tell us your experience in the comments section below!

What do you think of this tutorial?

Article Title: How to send activation email from FreshDesk using Zapier and Python

Short Description: Looking for a way to send a Freshdesk activation email automatically? Click here to read our comprehensive tutorial!

Author: Viktor Nadeyin

Publisher - Orgnization: MemberFix

Publisher Logo: mermberfix logo x200 1 - Automatically Send FreshDesk Activation Email On Signup

User Review
5 (1 vote)
Share This