Trigger a Rampiva Automate Job by Email by Using Incoming Webhooks

The material in this document is for informational purposes only. The products it describes are subject to change without prior notice, due to the manufacturer’s continuous development program. Rampiva makes no representations or warranties with respect to this document or with respect to the products described herein. Rampiva shall not be liable for any damages, losses, costs or expenses, direct, indirect or incidental, consequential or special, arising out of, or related to the use of this material or the products described herein.

Introduction

This article describes how to trigger a Rampiva Automate Job from an email.

Rampiva Automate cannot receive emails directly but has an incoming Webhook mechanism. In this article, we’ll use Zappier to receive the email, trigger the Rampiva Automate Job by making the Webhook call, and respond to the original email sender with the status of the Job.

This article is meant as an example to illustrate how Rampiva incoming Webhooks can be used to trigger jobs.

Prerequisites 


Instructions

A. Configure the Rampiva Workflow That Will Run When an Email Is Received

1

In Rampiva Automate, navigate to the Libraries tab.

2

Select Add + Workflow.

3

Select Blank Workflow.

4

Add the operation Script.

5

Set the Language: Python

6

Paste the following script code:

webhook_body = parameters.getJsonObject("{webhook_body}") emailSender = webhook_body["sender"] emailSubject = webhook_body["subject"] emailBody = webhook_body["body"] print "Job triggered by email received from "+emailSender+" with the subject "+emailSubject print "Email body:" print emailBody

This code will parse the data sent by the Webhook call in the {webhook_body} parameter and print it in the console. This script is for illustration purposes and does not do anything meaningful with the data sent in the email.

 

7

Click Next to move to the next step in the Workflow design.

8

Name the Workflow: Sample Webhook Print Email Details.

9

Click Add to add the Workflow to the Library.

 

B. Configure the Rampiva Schedule That Will Trigger the Job

1

In Rampiva Automate, navigate to the Jobs → Schedule tab.

2

Select Add + Job Schedule.

3

Name the Schedule: Sample Webhook Schedule.

4

Click Next.

5

Select the Trigger On a Webhook Trigger.

6

Select the HTTP Verb POST.

7

Click Next.

8

Select the Client and Matter under which the Job should run.

9

Click Next.

10

Select the previously created Workflow Sample Webhook Print Email Details.

11

Click Next.

12

Select the Execution Profile and Resource Pool under which the Job should run.

13

Click Next.

14

Verify the Schedule details.

15

Click Add.

A warning is shown indicating that the Webhook was set up without signature validation. Anyone with knowledge of the Webhook URL will be able to trigger the Schedule. For this reason, the Webhook URL should be kept secret.

16

Copy the Webhook URL by clicking on the Copy button and take note of the URL.

 

C. Create the Zappier Zap That Will Call Rampiva When an Email Is Received

1

Browse to the Zappier Zaps page https://zapier.com/app/zaps

2

Create a new Zap by clicking on the + Create button and selecting New Zap.

3

Select the trigger Email by Zapier.

4

Select the event New Inbound Email.

5

Click Continue.

6

Type the email address to create for this Zap, for example, rampivacompanyname.

7

Copy the full email address and take note of it.

8

Click Continue.

9

Send a test email to the Zapier email address.

10

Click Test trigger

If no email was found, wait 1 minute and click Test trigger again.

11

Scroll down and click Continue with selected record.

12

Select the action Webhooks by Zapier.

13

Select the event POST.

14

Click Continue.

15

In the URL field, paste the Webhook URL recorded in Rampiva in the previous section.

16

In the Payload Type, select json.

17

In the Data section, add a line with name sender and select the value 1. From Email.

18

Add a line with name subject and select the value 1. Subject.

19

In the Data section, add a line with name body and select the value 1. Body Plain.

20

Scroll down and click Continue.

21

Confirm that the data fields are populated with the information submitted in the test email.

22

Click Test action.

23

Confirm that the response contains the status OK.

24

In Rampiva Automate, confirm that a Job was triggered.

25

Return to Zapier

26

Click on the + (plus) symbol to add another action.

27

Select the action Email by Zapier.

28

In the To field, select 1. Sender

29

In the Subject field, type “RE: “ and then select 1. Subject

30

In the Body field, type “The Job status is ” and then select 2. Status.

31

In the Body field, continue typing “Job ID: ” and then select 2. Job Id.

32

Scroll down and click Continue.

33

Confirm that the fields are populated with the information from the original email as well as the Job status.

34

Click Test action.

35

Confirm that you received an email with the Job status and ID.

36

Click Publish.