Mail Receiver Adapter in SAP CPI
This article is an end to end guide on using Mail Receiver Adapter in SAP CPI for Gmail account.
Table Of Content
Prerequisites
- You have setup a trial account, created a Tenant and have assigned yourself all the required roles.
- You have created Package.
Initial setups to Gmail account
Step 1 : Go to your Gmail settings–> Under Security tab, enable Two-Step verification. After enabling, you will get an option to set up app passwords. Click on App Passwords as shown below.
Step 2 : In select app drop down, select Other( Custom Name).
Step 3 : Give Any name of your choice and Click on Generate .
Step 4 : You will receive an 16 digit pass-code. Copy this to your clip board. You will require this for security set ups in your tenant.
Security Set Ups in Overview Window
Step 5 : Click on the eye symbol highlighted to reach Monitoring window.
Step 6 :Choose Connectivity Tests Tile .
Step 7 : Select SMTP and fill the details as below. Don’t forget to un check the Valid Server Certificate Required button. Click on Send.
This is performed to check connectivity to the SMTP server of Gmail.
Step 8 : You will receive the required Server certificates. Click on Download symbol as highlighted below. This will give you a zip file with two certificates in it.
Step 9 : Now Click on Keystore Tile.
Step 10 : Click on ADD –> Certificate
Step 11 : Give any Alias name of your choice and Browse to the Certificate that you have downloaded and add it.
Step 12 : Repeat the same for another certificate too.
Step 13 : Click on Security Material Tile.
Step 14 : Click on Add –> User Credentials
Step 15 : Name: Any name of your choice ( Remember this name ).
Type: User Credentials
User: The Gmail ID from which you want to send mail ( Sender Gmail ID).
Password: The app password generated after two step verification in Step 4.
Once filled, Deploy.
Creating Integration Flow in Design Window
Step 16 : Click on Add –> Integration Flow under Artifacts tab of your Package.
Step 17 : Check Create radio button, Enter the mandatory fields. Press OK
Step 18 : Click on the newly created Integration flow.
Step 19 : Click on Edit
Step 20 : Select a Timer from Pallet to your left.
Step 21 : Delete the Start Event and replace it with Timer.
Step 22 : Select Content Modifier from the Pallet and place to the right of Timer.
Step 23 : Click on Timer. In Scheduler tab, Choose Run Once radio button
Step 24 : Click on Content Modifier. In Message Body tab, Choose Type = Constant. and in Body type any Message as shown below.
Step 25 : Drag the arrow on End Event towards the Receiver.
Step 26 : From the pop up appearing, Choose Mail adapter.
Step 27 : In Connection tab, Fill the details as shown below. Credential Name will be the Name you gave in last step of setup.
Step 28 : In the processing tab Fill the From, To, Subject tabs. Keep the rest as it is.
Step 29 : Click on Save and then Deploy.
Monitoring the Deployed Integration Flow
Step 30 : Go to the monitoring tab and click on All started.
Step 31 : Check the status of your flow to be complete.
Step 32 : If its Success as shown below, You will receive the mail to the Gmail address specified in To field with the Subject that you gave.
In case of any error, Check your Gmail account if the access to low security apps is enabled. It needs to be enabled. Feel free to comment your queries.
FINAL VERDICT :
In conclusion, I hope you enjoyed reading this article on “Mail Receiver Adapter in SAP – CPI : A step by step Guide!”, If yes, then don’t forget to spread a word about it. Do send the feedback and to know more about it. Signing off sudarshan@recodehive.com