From c6dc1a8eb3719df4d31541965c8bfb6a7f704728 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Wed, 22 Jan 2025 19:08:47 +0530 Subject: [PATCH] Backend/enh/added-more-params-support-for-whatsapp --- .github/workflows/nix.yml | 4 ++-- .../src/Kernel/External/Whatsapp/GupShup/Flow.hs | 14 +++++++++++--- .../Kernel/External/Whatsapp/Interface/GupShup.hs | 2 +- .../Kernel/External/Whatsapp/Interface/Types.hs | 4 ++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 55ca1fdd2..b7720f662 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -3,9 +3,9 @@ name: CI on: # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: ["main"] + branches: ["main", "prodHotPush-Common"] pull_request: - branches: ["main"] + branches: ["main", "prodHotPush-Common"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/lib/mobility-core/src/Kernel/External/Whatsapp/GupShup/Flow.hs b/lib/mobility-core/src/Kernel/External/Whatsapp/GupShup/Flow.hs index 9031877e8..3d3bafca8 100644 --- a/lib/mobility-core/src/Kernel/External/Whatsapp/GupShup/Flow.hs +++ b/lib/mobility-core/src/Kernel/External/Whatsapp/GupShup/Flow.hs @@ -53,6 +53,10 @@ type GupShupSendMessageWithTemplateIdAPI = :> QueryParam "var1" Text :> QueryParam "var2" Text :> QueryParam "var3" Text + :> QueryParam "var4" Text + :> QueryParam "var5" Text + :> QueryParam "var6" Text + :> QueryParam "var7" Text :> QueryParam "cta_button_url" Text :> QueryParam "isTemplate" Bool :> MandatoryQueryParam "template_id" Text @@ -74,7 +78,7 @@ type GupShupSendOtpAPI = gupShupOptAPIClient :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> EulerClient Whatsapp.OptApiResp gupShupSendOtpAPIClient :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Maybe Bool -> EulerClient Whatsapp.SendOtpApiResp -gupShupSendMessageWithTemplateIdAPIClient :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> Text -> EulerClient Whatsapp.SendOtpApiResp +gupShupSendMessageWithTemplateIdAPIClient :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> Text -> EulerClient Whatsapp.SendOtpApiResp gupShupOptAPIClient :<|> gupShupSendOtpAPIClient :<|> gupShupSendMessageWithTemplateIdAPIClient = client (Proxy :: Proxy GupShupAPI) whatsAppOptAPI :: @@ -157,9 +161,13 @@ whatsAppSendMessageWithTemplateIdAPI :: Maybe Text -> Maybe Text -> Maybe Text -> + Maybe Text -> + Maybe Text -> + Maybe Text -> + Maybe Text -> Maybe Bool -> Text -> m Whatsapp.SendWhatsAppMessageApiResp -whatsAppSendMessageWithTemplateIdAPI url userid password sendTo method auth_scheme v msgType format var1 var2 var3 ctaButtonUrl containsUrlButton templateId = do - callAPI url (gupShupSendMessageWithTemplateIdAPIClient userid password sendTo method auth_scheme v msgType format var1 var2 var3 ctaButtonUrl containsUrlButton templateId) "GupShup WhatsApp Message with TemplateId API" (Proxy :: Proxy GupShupAPI) +whatsAppSendMessageWithTemplateIdAPI url userid password sendTo method auth_scheme v msgType format var1 var2 var3 var4 var5 var6 var7 ctaButtonUrl containsUrlButton templateId = do + callAPI url (gupShupSendMessageWithTemplateIdAPIClient userid password sendTo method auth_scheme v msgType format var1 var2 var3 var4 var5 var6 var7 ctaButtonUrl containsUrlButton templateId) "GupShup WhatsApp Message with TemplateId API" (Proxy :: Proxy GupShupAPI) >>= checkGupShupOptError url diff --git a/lib/mobility-core/src/Kernel/External/Whatsapp/Interface/GupShup.hs b/lib/mobility-core/src/Kernel/External/Whatsapp/Interface/GupShup.hs index 001eae6fb..03d4d1e96 100644 --- a/lib/mobility-core/src/Kernel/External/Whatsapp/Interface/GupShup.hs +++ b/lib/mobility-core/src/Kernel/External/Whatsapp/Interface/GupShup.hs @@ -73,4 +73,4 @@ whatsAppSendMessageWithTemplateIdAPI GupShupCfg {..} SendWhatsAppMessageWithTemp userId <- decrypt userid password' <- decrypt password gupShupUrl <- parseBaseUrl url - Ex.whatsAppSendMessageWithTemplateIdAPI gupShupUrl userId password' sendTo otpCfg.method authScheme v otpCfg.msgType format var1 var2 var3 ctaButtonUrl containsUrlButton templateId + Ex.whatsAppSendMessageWithTemplateIdAPI gupShupUrl userId password' sendTo otpCfg.method authScheme v otpCfg.msgType format var1 var2 var3 var4 var5 var6 var7 ctaButtonUrl containsUrlButton templateId diff --git a/lib/mobility-core/src/Kernel/External/Whatsapp/Interface/Types.hs b/lib/mobility-core/src/Kernel/External/Whatsapp/Interface/Types.hs index 3cba5000b..3171898ea 100644 --- a/lib/mobility-core/src/Kernel/External/Whatsapp/Interface/Types.hs +++ b/lib/mobility-core/src/Kernel/External/Whatsapp/Interface/Types.hs @@ -75,6 +75,10 @@ data SendWhatsAppMessageWithTemplateIdApIReq = SendWhatsAppMessageWithTemplateId var1 :: Maybe Text, var2 :: Maybe Text, var3 :: Maybe Text, + var4 :: Maybe Text, + var5 :: Maybe Text, + var6 :: Maybe Text, + var7 :: Maybe Text, ctaButtonUrl :: Maybe Text, containsUrlButton :: Maybe Bool }