Automate Offer Letter Generation by using SAP BTP Process Automation
Share

In this blog, I am going to show you that how to automate the generation of offer letter using SAP BTP Process Automation.
Overview of the Automation Process
This automation process involves opening a Word file template, replacing placeholders with the new joinee’s details, saving the customized offer letter, and sending it via email to the respective candidate.

First of all, we should have a offer letter template saved as docx file in our desktop as below :

Shubham_Singh_01_0-1752574564865.png

Shubham_Singh_01_1-1752574594737.pngShubham_Singh_01_2-1752574605336.png

Create a new automation project
Log into SAP Build Lobby.
Click create -> Automated Process->Automation and click on next

Shubham_Singh_01_3-1752574657205.pngShubham_Singh_01_4-1752574665430.png

Name your project ‘OfferLetterGenerator’.
Provide a short description  “Bot to generate offer letter”.

Click on ‘Review’ and then ‘Create’.

Designing the Automation Bot
In the automation section, click create -> automation and give the agent version

Shubham_Singh_01_5-1752574703102.png

name it ‘Offer Letter Generator’ and add description as ‘ An automation which generates offer letter and send email to respective candidate’.

Shubham_Singh_01_6-1752574728596.png
Click on create.

Click on setting option, go to dependencies and  click on add -> Add a business process project dependency, then add ‘outlook SDK’  and ‘word SDK’ ( as in this automation we are going to use WORD and OUTLOOK so it is necessary as it makes available the different activities related to that particular software in our activities section )

Shubham_Singh_01_7-1752574781647.pngShubham_Singh_01_8-1752574789779.png

Similarly add word SDK.

The key input parameters for this automation are:

  • companyName
  • candidateName
  • canAddress
  • currentdate
  • post
  • technologyunit
  • city
  • salary
  • joiningDate
  • HrManagerName
  • hremail
  • HrPhoneNumber
  • senderemail
  • receiveremail

So go to Input/Output section and create those input parameters as like : –

Shubham_Singh_01_9-1752574834481.png

Similarly add all other input parameters as well.

Now, Add these activities by drag & drop from the tools section : –
i) Open Word Instance
ii) Open Document(Word)
iii) Replace All(Word)
iv) Save As(Word)
v) Close Document (Word)
vi) Close Word Instance
vii) Open Outlook Instance
viii) Send Email (Outlook)
ix) Close Outlook Instance

Shubham_Singh_01_10-1752574879570.pngShubham_Singh_01_11-1752574887722.png

In Open Document (Word) activity, in parameter section add the path of offer letter template in ‘documentPath’ field.

Shubham_Singh_01_0-1752580179910.png

 

And in ‘replace all (word)’ activity give the placeholder and value name in old string and new string section for each detail which is needed to be replaced ,
as like this:

Shubham_Singh_01_13-1752574925971.pngShubham_Singh_01_14-1752574941744.png
Similarly do for all placeholders.

After that, in Save As (Word) activity set the filepath as ‘ “{Folderlocation}\” + Step0.candidateName + “_Offer_Letter.docx” ’ ( so that the new offer letter word file generated is saved as that respective candidate name).

Shubham_Singh_01_1-1752580275128.png

 

Now go to Send Email (Outlook) activity, and add parameters as,
from -> senderemail
to -> receiveremail
Subject -> Letter of Joining
Body -> “Please find the offer letter attached and report to the assigned location on exact date.”
In attachment section click on custom data and add string value as the file location as
 ‘ “{Folderlocation}\” + Step0.candidateName + “_Offer_Letter.docx” ’

Shubham_Singh_01_16-1752574990772.pngShubham_Singh_01_17-1752575000424.png
Finally, Run the automation and fill the details in input fields : –

Shubham_Singh_01_19-1752576729091.pngthen click on test and you will find that a word file of offer letter with candidate name created at the folder location and a mail is sent to respective receiver. 

Benefits of this automation: –

  • Automating the offer letter generation process significantly reduces the time required to create and send offer letters.
  • It minimizes the risk of human error, ensuring that all details are correctly filled in.
  • The use of a standardized template ensures that all offer letters maintain a consistent format and tone.

 

  Read More Technology Blog Posts by Members articles 

#abap

By ali