Skip to content

Commit

Permalink
Backend/enh/added-more-params-support-for-whatsapp (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
prashant601 authored Jan 29, 2025
1 parent 006f215 commit f4d252a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 11 additions & 3 deletions lib/mobility-core/src/Kernel/External/Whatsapp/GupShup/Flow.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ::
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f4d252a

Please sign in to comment.