Lambda request body parsing issue using AWS api gateway - ruby
I am facing an issue while receiving a request from Mailgun, which contains an email attribute in the request body. I have deployed an AWS lambda function along with an API gateway. When a request comes through the AWS API gateway, it encodes the body content and passes the request to the Lambda function, but my lambda function couldn’t decode the content in such a way to consume through our implementation.
I have tested my implementation without using the AWS API gateway, and it works, but it doesn't work along with the AWS API gateway.
When I'm converting request body content that comes through the API gateway, which was encoded by the API gateway but I can't convert the request body in the form to consume it.
After decoded, I am getting this -
Base64.strict_decode64(base64string)
"Content-Type=multipart%2Falternative%3B+boundary%3D%22772a87c3bfe6815a93e5a01ac72bf6f3304ff90d08696b62b907422a03a3%22&Date=Fri%2C+13+Jan+2023+10%3A44%3A06+%2B0000&From=VueOps+Warranty+Ticket+%3Cservice-requests-qa%40mg.vueops-qa.com%3E&In-Reply-To%5B%5D=20230113104406.86d5542bf7d85f30%40mg.vueops-qa.com&Message-Id=%3C20230113104406.962d120183579f0f%40mg.vueops-qa.com%3E&Mime-Version=1.0&Sender=service-requests-qa%40mg.vueops-qa.com&Subject=Warranty+Ticket+SUM-EST-0204+for+Email+Subject+Test+edit+for+Sumit%27s+Test+has+been+issued+to+you+for+coordination&To=service-requests-qa%40mg.vueops-qa.com&body-html=%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%3Cmeta+content%3D%22text%2Fhtml%3B+charset%3Dutf-8%22+http-equiv%3D%22Content-Type%22%3E%0A%3Cstyle%3Ebody+%7B%0Afont-family%3A+%27Calibri%27%2C+%27Arial%27%2C+sans-serif%3B%0A%7D%0Aimg+%7B%0Aoutline%3A+none%3B+text-decoration%3A+none%3B+-ms-interpolation-mode%3A+bicubic%3B%0A%7D%0A%3C%2Fstyle%3E%0A%3C%2Fhead%3E%0A%3Cbody+style%3D%22font-family%3A+%27Calibri%27%2C+%27Arial%27%2C+sans-serif%3B%22%3E%0A%3Ctable+align%3D%22center%22+cellpadding%3D%220%22+cellspacing%3D%220%22+class%3D%22logo%22+width%3D%22100%25%22%3E%3Ctr%3E%3Ctd+align%3D%22left%22%3E%3Cimg+src%3D%22https%3A%2F%2Fs3-us-west-1.amazonaws.com%2Fdpr-email-assets%2FVueOPS-logo-full-color-ps.png%22+style%3D%22outline%3A+none%3B+text-decoration%3A+none%3B+-ms-interpolation-mode%3A+bicubic%3B+width%3A+120px%3B%22%3E%3C%2Ftd%3E%3C%2Ftr%3E%3C%2Ftable%3E%0A%3Cp%3E%3C%2Fp%3E%0A%3Cp%3E%0A++++Hello%2C%0A%3C%2Fp%3E%0A%3Cp+class%3D%22ng-binding%22%3E%0A++++A+new+Warranty+Ticket+has+been+issued+for+Email+Subject+Test+edit+for+Sumit%27s+Test.%0A++++%3Cstrong%3EPlease+follow+the+steps+below+to+resolve+this+issue.%3C%2Fstrong%3E%0A%3C%2Fp%3E%0A%3Cp%3E%0A++++%3Cbr%3E%0A++++%3Cstrong%3ESTEP+1%3A%3C%2Fstrong%3E%0A++++Contact+the+client+contact+noted+below+for+scheduling+your+inspection+and+repair.+You+may+contact+the+client+by+phone+or+by+replying-all+to+this+email.%0A++++%3Cbr%3E%0A%3C%2Fp%3E%0A%3Cp+class%3D%22ng-binding%22%3E%0A++++%3Cstrong+style%3D%22font-size%3A+1.1em%3B%22%3EWarranty+Ticket+Details%3A%3C%2Fstrong%3E%0A++++%3Cbr%3E%0A++++%3Cstrong%3ETicket+%23%3A%3C%2Fstrong%3E+SUM-EST-0204%0A++++%3Cbr%3E%0A++++%3Cstrong%3EClient%3A%3C%2Fstrong%3E+Sumit%27s+Test%0A++++%3Cbr%3E%0A++++%3Cstrong%3EFacility%3A%3C%2Fstrong%3E+Email+Subject+Test+edit%0A++++%3Cbr%3E%0A++++%3Cstrong%3EProject%3A%3C%2Fstrong%3E+118+docs%0A++++%3Cbr%3E%0A++++%3Cstrong%3ETitle%3A%3C%2Fstrong%3E+Perferendis+voluptat%0A++++%3Cbr%3E%0A++++%3Cstrong%3EDescription%3A%3C%2Fstrong%3E+In+excepteur+aliquid%0A++++%3Cbr%3E%0A++++%3Cstrong%3ELocation%3A%3C%2Fstrong%3E+Sed+sint+nihil+moles%0A++++%3Cbr%3E%0A++++%3Cstrong%3EPriority%3A%3C%2Fstrong%3E+Emergency%0A++++%3Cbr%3E%0A++++%3Cstring%3EYou+can+view+the+ticket+details+here%3A%3C%2Fstring%3E%0A++++%3Cbr%3E%3Cbr%3E%0A++++%3Ca+ng-href%3D%22https%3A%2F%2Fsumit-s-test.vueops-qa.com%2Fservice_requests%2Fsum-est-0204%22+class%3D%22ng-binding%22+href%3D%22https%3A%2F%2Fsumit-s-test.vueops-qa.com%2Fservice_requests%2Fsum-est-0204%22+style%3D%22color%3A+%232e74b5%3B+text-decoration%3A+none%3B%22%3Ehttps%3A%2F%2Fsumit-s-test.vueops-qa.com%2Fservice_requests%2Fsum-est-0204%3C%2Fa%3E%0A++++%3Cbr%3E%0A%3C%2Fp%3E%0A%0A%3Cp%3E%0A++++%3Cstrong%3EFacility+Address%3A%3C%2Fstrong%3E%0A++++%3Cbr%3E%0A++++%3Cspan+ng-bind-html%3D%22serviceRequest.formattedFacilityAddress%22+class%3D%22ng-binding%22%3EMetro+Street%3Cbr%3EB+23+Street%3Cbr%3ENoida+City%2C+NCR+State+110092%3C%2Fspan%3E%0A++++%3Cbr%3E%0A%3C%2Fp%3E%0A%0A%3Cp+class%3D%22ng-binding%22%3E%0A++++%3Cstrong%3EClient+Contact+Information%3C%2Fstrong%3E%0A++++%3Cbr%3E%0A++++%3Cstrong%3EName%3A%3C%2Fstrong%3E+Sumit+Vueops+Account%0A++++%3Cbr%3E%0A++++%3Cstrong%3EEmail%3A%3C%2Fstrong%3E+sumitka%40vueops.com%0A++++%3Cbr%3E%0A++++%3Cstrong%3EPhone+Number%3A%3C%2Fstrong%3E+999-687-4668%0A%3C%2Fp%3E%0A%0A%3Cp%3E%0A++++%3Cstrong%3ESTEP+2%3A%3C%2Fstrong%3E%0A++++When+the+repair+work+is+complete+we+ask+that+you+respond+to+this+email+with+the+following+information+and+a+photo+of+the+completed+work%3A%0A++++%3Cbr%3E%0A%3C%2Fp%3E%0A%3Cp%3E%0A++++%3Cstrong%3EWork+Performed%3C%2Fstrong%3E%0A++++%3Cbr%3E%0A++++%3Cbr%3E%0A++++%3Cstrong%3ERoot+Cause%3A%3C%2Fstrong%3E%0A++++%3Cbr%3E%0A++++%3Cstrong%3ERepair+Date%3A%3C%2Fstrong%3E%0A%3C%2Fp%3E%0A%0A%3Cp%3E%0A++++%0A+%3C%2Fp%3E%0A%3Cdiv+class%3D%22footer%22+style%3D%22font-size%3A+10pt%3B+font-family%3A+%27FrnkGothITC+Bk+BT%27%2C+%27Calibri%27%2C+%27Arial%27%2C+sans-serif%3B+color%3A+%23999999%3B+letter-spacing%3A+2pt%3B%22%3E%3Cp%3EThank+You%2C+%3Cbr%3EPowered+by+%3Ca+href%3D%22www.vueops.com%22+style%3D%22color%3A+%232e74b5%3B+text-decoration%3A+none%3B%22%3EVueOps%3C%2Fa%3E%3Cbr%3EKnow+Your+Building+Inside+Out%3Csup%3ETM%3Csup%3E%3C%2Fsup%3E%3C%2Fsup%3E%3C%2Fp%3E%3C%2Fdiv%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A&body-plain=Hello%2C%0A%0AA+new+Warranty+Ticket+has+been+issued+for+Email+Subject+Test+edit+for+Sumit%27s+Test.%0APlease+follow+the+steps+below+to+resolve+this+issue.%0A%0ASTEP+1%3A%0AContact+the+client+contact+noted+below+for+scheduling+your+inspection+and+repair.+You+may+contact+the+client+by+phone+or+by+replying-all+to+this+email.%0A%0AWarranty+Ticket+Details%3A%0A%0ATicket+%23%3A+SUM-EST-0204%0A%0AClient%3A+Sumit%27s+Test%0A%0AFacility%3A+Email+Subject+Test+edit%0A%0AProject%3A+118+docs%0A%0ATitle%3A+Perferendis+voluptat%0A%0ADescription%3A+In+excepteur+aliquid%0A%0ALocation%3A+Sed+sint+nihil+moles%0A%0APriority%3A+Emergency%0A%0AYou+can+view+the+ticket+details+here%3A%0A%0Ahttps%3A%2F%2Fsumit-s-test.vueops-qa.com%2Fservice_requests%2Fsum-est-0204+%28+https%3A%2F%2Fsumit-s-test.vueops-qa.com%2Fservice_requests%2Fsum-est-0204+%29%0A%0AFacility+Address%3A%0A%0AMetro+Street%0AB+23+Street%0ANoida+City%2C+NCR+State+110092%0A%0AClient+Contact+Information%0A%0AName%3A+Sumit+Vueops+Account%0A%0AEmail%3A+sumitka%40vueops.com%0A%0APhone+Number%3A+999-687-4668%0A%0ASTEP+2%3A%0AWhen+the+repair+work+is+complete+we+ask+that+you+respond+to+this+email+with+the+following+information+and+a+photo+of+the+completed+work%3A%0A%0AWork+Performed%0A%0ARoot+Cause%3A%0A%0ARepair+Date%3A%0A%0AThank+You%2C%0APowered+by+VueOps+%28+www.vueops.com+%29%0AKnow+Your+Building+Inside+OutTM&from=VueOps+Warranty+Ticket+%3Cservice-requests-qa%40mg.vueops-qa.com%3E&message-headers=%5B%5B%22Mime-Version%22%2C%221.0%22%5D%2C%5B%22Content-Type%22%2C%22multipart%2Falternative%3B+boundary%3D%5C%22772a87c3bfe6815a93e5a01ac72bf6f3304ff90d08696b62b907422a03a3%5C%22%22%5D%2C%5B%22Subject%22%2C%22Warranty+Ticket+SUM-EST-0204+for+Email+Subject+Test+edit+for+Sumit%27s+Test+has+been+issued+to+you+for+coordination%22%5D%2C%5B%22From%22%2C%22VueOps+Warranty+Ticket+%3Cservice-requests-qa%40mg.vueops-qa.com%3E%22%5D%2C%5B%22To%22%2C%22service-requests-qa%40mg.vueops-qa.com%22%5D%2C%5B%22In-Reply-To%5B%5D%22%2C%2220230113104406.86d5542bf7d85f30%40mg.vueops-qa.com%22%5D%2C%5B%22Message-Id%22%2C%22%3C20230113104406.962d120183579f0f%40mg.vueops-qa.com%3E%22%5D%2C%5B%22Date%22%2C%22Fri%2C+13+Jan+2023+10%3A44%3A06+%2B0000%22%5D%2C%5B%22Sender%22%2C%22service-requests-qa%40mg.vueops-qa.com%22%5D%5D&recipient=service-requests-qa%40mg.vueops-qa.com&sender=VueOps+Warranty+Ticket+%3Cservice-requests-qa%40mg.vueops-qa.com%3E&signature=69257cd5ebdff97507389baaa401c9f7d370b25e43135c8695342b676412ac42&stripped-html=%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%3Cmeta+content%3D%22text%2Fhtml%3B+charset%3Dutf-8%22+http-equiv%3D%22Content-Type%22%3E%0A%3Cstyle%3Ebody+%7B%0Afont-family%3A+%27Calibri%27%2C+%27Arial%27%2C+sans-serif%3B%0A%7D%0Aimg+%7B%0Aoutline%3A+none%3B+text-decoration%3A+none%3B+-ms-interpolation-mode%3A+bicubic%3B%0A%7D%0A%3C%2Fstyle%3E%0A%3C%2Fhead%3E%0A%3Cbody+style%3D%22font-family%3A+%27Calibri%27%2C+%27Arial%27%2C+sans-serif%3B%22%3E%0A%3Ctable+align%3D%22center%22+cellpadding%3D%220%22+cellspacing%3D%220%22+class%3D%22logo%22+width%3D%22100%25%22%3E%3Ctr%3E%3Ctd+align%3D%22left%22%3E%3Cimg+src%3D%22https%3A%2F%2Fs3-us-west-1.amazonaws.com%2Fdpr-email-assets%2FVueOPS-logo-full-color-ps.png%22+style%3D%22outline%3A+none%3B+text-decoration%3A+none%3B+-ms-interpolation-mode%3A+bicubic%3B+width%3A+120px%3B%22%3E%3C%2Ftd%3E%3C%2Ftr%3E%3C%2Ftable%3E%0A%3Cp%3E%3C%2Fp%3E%0A%3Cp%3E%0A++++Hello%2C%0A%3C%2Fp%3E%0A%3Cp+class%3D%22ng-binding%22%3E%0A++++A+new+Warranty+Ticket+has+been+issued+for+Email+Subject+Test+edit+for+Sumit%27s+Test.%0A++++%3Cstrong%3EPlease+follow+the+steps+below+to+resolve+this+issue.%3C%2Fstrong%3E%0A%3C%2Fp%3E%0A%3Cp%3E%0A++++%3Cbr%3E%0A++++%3Cstrong%3ESTEP+1%3A%3C%2Fstrong%3E%0A++++Contact+the+client+contact+noted+below+for+scheduling+your+inspection+and+repair.+You+may+contact+the+client+by+phone+or+by+replying-all+to+this+email.%0A++++%3Cbr%3E%0A%3C%2Fp%3E%0A%3Cp+class%3D%22ng-binding%22%3E%0A++++%3Cstrong+style%3D%22font-size%3A+1.1em%3B%22%3EWarranty+Ticket+Details%3A%3C%2Fstrong%3E%0A++++%3Cbr%3E%0A++++%3Cstrong%3ETicket+%23%3A%3C%2Fstrong%3E+SUM-EST-0204%0A++++%3Cbr%3E%0A++++%3Cstrong%3EClient%3A%3C%2Fstrong%3E+Sumit%27s+Test%0A++++%3Cbr%3E%0A++++%3Cstrong%3EFacility%3A%3C%2Fstrong%3E+Email+Subject+Test+edit%0A++++%3Cbr%3E%0A++++%3Cstrong%3EProject%3A%3C%2Fstrong%3E+118+docs%0A++++%3Cbr%3E%0A++++%3Cstrong%3ETitle%3A%3C%2Fstrong%3E+Perferendis+voluptat%0A++++%3Cbr%3E%0A++++%3Cstrong%3EDescription%3A%3C%2Fstrong%3E+In+excepteur+aliquid%0A++++%3Cbr%3E%0A++++%3Cstrong%3ELocation%3A%3C%2Fstrong%3E+Sed+sint+nihil+moles%0A++++%3Cbr%3E%0A++++%3Cstrong%3EPriority%3A%3C%2Fstrong%3E+Emergency%0A++++%3Cbr%3E%0A++++%3Cstring%3EYou+can+view+the+ticket+details+here%3A%3C%2Fstring%3E%0A++++%3Cbr%3E%3Cbr%3E%0A++++%3Ca+ng-href%3D%22https%3A%2F%2Fsumit-s-test.vueops-qa.com%2Fservice_requests%2Fsum-est-0204%22+class%3D%22ng-binding%22+href%3D%22https%3A%2F%2Fsumit-s-test.vueops-qa.com%2Fservice_requests%2Fsum-est-0204%22+style%3D%22color%3A+%232e74b5%3B+text-decoration%3A+none%3B%22%3Ehttps%3A%2F%2Fsumit-s-test.vueops-qa.com%2Fservice_requests%2Fsum-est-0204%3C%2Fa%3E%0A++++%3Cbr%3E%0A%3C%2Fp%3E%0A%0A%3Cp%3E%0A++++%3Cstrong%3EFacility+Address%3A%3C%2Fstrong%3E%0A++++%3Cbr%3E%0A++++%3Cspan+ng-bind-html%3D%22serviceRequest.formattedFacilityAddress%22+class%3D%22ng-binding%22%3EMetro+Street%3Cbr%3EB+23+Street%3Cbr%3ENoida+City%2C+NCR+State+110092%3C%2Fspan%3E%0A++++%3Cbr%3E%0A%3C%2Fp%3E%0A%0A%3Cp+class%3D%22ng-binding%22%3E%0A++++%3Cstrong%3EClient+Contact+Information%3C%2Fstrong%3E%0A++++%3Cbr%3E%0A++++%3Cstrong%3EName%3A%3C%2Fstrong%3E+Sumit+Vueops+Account%0A++++%3Cbr%3E%0A++++%3Cstrong%3EEmail%3A%3C%2Fstrong%3E+sumitka%40vueops.com%0A++++%3Cbr%3E%0A++++%3Cstrong%3EPhone+Number%3A%3C%2Fstrong%3E+999-687-4668%0A%3C%2Fp%3E%0A%0A%3Cp%3E%0A++++%3Cstrong%3ESTEP+2%3A%3C%2Fstrong%3E%0A++++When+the+repair+work+is+complete+we+ask+that+you+respond+to+this+email+with+the+following+information+and+a+photo+of+the+completed+work%3A%0A++++%3Cbr%3E%0A%3C%2Fp%3E%0A%3Cp%3E%0A++++%3Cstrong%3EWork+Performed%3C%2Fstrong%3E%0A++++%3Cbr%3E%0A++++%3Cbr%3E%0A++++%3Cstrong%3ERoot+Cause%3A%3C%2Fstrong%3E%0A++++%3Cbr%3E%0A++++%3Cstrong%3ERepair+Date%3A%3C%2Fstrong%3E%0A%3C%2Fp%3E%0A%0A%3Cp%3E%0A++++%0A+%3C%2Fp%3E%0A%3Cdiv+class%3D%22footer%22+style%3D%22font-size%3A+10pt%3B+font-family%3A+%27FrnkGothITC+Bk+BT%27%2C+%27Calibri%27%2C+%27Arial%27%2C+sans-serif%3B+color%3A+%23999999%3B+letter-spacing%3A+2pt%3B%22%3E%3Cp%3EThank+You%2C+%3Cbr%3EPowered+by+%3Ca+href%3D%22www.vueops.com%22+style%3D%22color%3A+%232e74b5%3B+text-decoration%3A+none%3B%22%3EVueOps%3C%2Fa%3E%3Cbr%3EKnow+Your+Building+Inside+Out%3Csup%3ETM%3Csup%3E%3C%2Fsup%3E%3C%2Fsup%3E%3C%2Fp%3E%3C%2Fdiv%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A&stripped-signature=Work+Performed%0A%0ARoot+Cause%3A%0A%0ARepair+Date%3A%0A%0AThank+You%2C%0APowered+by+VueOps+%28+www.vueops.com+%29%0AKnow+Your+Building+Inside+OutTM&stripped-text=Hello%2C%0A%0AA+new+Warranty+Ticket+has+been+issued+for+Email+Subject+Test+edit+for+Sumit%27s+Test.%0APlease+follow+the+steps+below+to+resolve+this+issue.%0A%0ASTEP+1%3A%0AContact+the+client+contact+noted+below+for+scheduling+your+inspection+and+repair.+You+may+contact+the+client+by+phone+or+by+replying-all+to+this+email.%0A%0AWarranty+Ticket+Details%3A%0A%0ATicket+%23%3A+SUM-EST-0204%0A%0AClient%3A+Sumit%27s+Test%0A%0AFacility%3A+Email+Subject+Test+edit%0A%0AProject%3A+118+docs%0A%0ATitle%3A+Perferendis+voluptat%0A%0ADescription%3A+In+excepteur+aliquid%0A%0ALocation%3A+Sed+sint+nihil+moles%0A%0APriority%3A+Emergency%0A%0AYou+can+view+the+ticket+details+here%3A%0A%0Ahttps%3A%2F%2Fsumit-s-test.vueops-qa.com%2Fservice_requests%2Fsum-est-0204+%28+https%3A%2F%2Fsumit-s-test.vueops-qa.com%2Fservice_requests%2Fsum-est-0204+%29%0A%0AFacility+Address%3A%0A%0AMetro+Street%0AB+23+Street%0ANoida+City%2C+NCR+State+110092%0A%0AClient+Contact+Information%0A%0AName%3A+Sumit+Vueops+Account%0A%0AEmail%3A+sumitka%40vueops.com%0A%0APhone+Number%3A+999-687-4668%0A%0ASTEP+2%3A%0AWhen+the+repair+work+is+complete+we+ask+that+you+respond+to+this+email+with+the+following+information+and+a+photo+of+the+completed+work%3A%0A&subject=Warranty+Ticket+SUM-EST-0204+for+Email+Subject+Test+edit+for+Sumit%27s+Test+has+been+issued+to+you+for+coordination×tamp=1673613697&token=9e50b9d3b4b4cfac741c4e0a7d154ca9b52a69146937cc2ba4"
which should be like this -
{"Content-Type"=>"multipart/alternative; boundary=\"0d4b5135bbc71f7078e98fd7ee7355506fb2c219e22a702a301bd7123e55\"", "Date"=>"Fri, 13 Jan 2023 18:31:51 +0000", "From"=>"VueOps Warranty Ticket <service-requests-qa#mg.vueops-qa.com>", "In-Reply-To"=>["20230113183151.bad48c4ced209202#mg.vueops-qa.com"], "Message-Id"=>"<20230113183151.74967e8866be2d25#mg.vueops-qa.com>", "Mime-Version"=>"1.0", "Sender"=>"service-requests-qa#mg.vueops-qa.com", "Subject"=>"Warranty Ticket SUM-EST-0204 for Email Subject Test edit for Sumit's Test has been issued to you for coordination", "To"=>"service-requests-qa#mg.vueops-qa.com", "body-html"=>"<!DOCTYPE html>\n<html>\n<head>\n<meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n<style>body {\nfont-family: 'Calibri', 'Arial', sans-serif;\n}\nimg {\noutline: none; text-decoration: none; -ms-interpolation-mode: bicubic;\n}\n</style>\n</head>\n<body style=\"font-family: 'Calibri', 'Arial', sans-serif;\">\n<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"logo\" width=\"100%\"><tr><td align=\"left\"><img src=\"https://s3-us-west-1.amazonaws.com/dpr-email-assets/VueOPS-logo-full-color-ps.png\" style=\"outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; width: 120px;\"></td></tr></table>\n<p></p>\n<p>\n Hello,\n</p>\n<p class=\"ng-binding\">\n A new Warranty Ticket has been issued for Email Subject Test edit for Sumit's Test.\n <strong>Please follow the steps below to resolve this issue.</strong>\n</p>\n<p>\n <br>\n <strong>STEP 1:</strong>\n Contact the client contact noted below for scheduling your inspection and repair. You may contact the client by phone or by replying-all to this email.\n <br>\n</p>\n<p class=\"ng-binding\">\n <strong style=\"font-size: 1.1em;\">Warranty Ticket Details:</strong>\n <br>\n <strong>Ticket #:</strong> SUM-EST-0204\n <br>\n <strong>Client:</strong> Sumit's Test\n <br>\n <strong>Facility:</strong> Email Subject Test edit\n <br>\n <strong>Project:</strong> 118 docs\n <br>\n <strong>Title:</strong> Perferendis voluptat\n <br>\n <strong>Description:</strong> In excepteur aliquid\n <br>\n <strong>Location:</strong> Sed sint nihil moles\n <br>\n <strong>Priority:</strong> Emergency\n <br>\n <string>You can view the ticket details here:</string>\n <br><br>\n <a ng-href=\"https://sumit-s-test.vueops-qa.com/service_requests/sum-est-0204\" class=\"ng-binding\" href=\"https://sumit-s-test.vueops-qa.com/service_requests/sum-est-0204\" style=\"color: #2e74b5; text-decoration: none;\">https://sumit-s-test.vueops-qa.com/service_requests/sum-est-0204</a>\n <br>\n</p>\n\n<p>\n <strong>Facility Address:</strong>\n <br>\n <span ng-bind-html=\"serviceRequest.formattedFacilityAddress\" class=\"ng-binding\">Metro Street<br>B 23 Street<br>Noida City, NCR State 110092</span>\n <br>\n</p>\n\n<p class=\"ng-binding\">\n <strong>Client Contact Information</strong>\n <br>\n <strong>Name:</strong> Sumit Vueops Account\n <br>\n <strong>Email:</strong> sumitka#vueops.com\n <br>\n <strong>Phone Number:</strong> 999-687-4668\n</p>\n\n<p>\n <strong>STEP 2:</strong>\n When the repair work is complete we ask that you respond to this email with the following information and a photo of the completed work:\n <br>\n</p>\n<p>\n <strong>Work Performed</strong>\n <br>\n <br>\n <strong>Root Cause:</strong>\n <br>\n <strong>Repair Date:</strong>\n</p>\n\n<p>\n \n </p>\n<div class=\"footer\" style=\"font-size: 10pt; font-family: 'FrnkGothITC Bk BT', 'Calibri', 'Arial', sans-serif; color: #999999; letter-spacing: 2pt;\"><p>Thank You, <br>Powered by VueOps<br>Know Your Building Inside Out<sup>TM<sup></sup></sup></p></div>\n</body>\n</html>\n", "body-plain"=>"Hello,\n\nA new Warranty Ticket has been issued for Email Subject Test edit for Sumit's Test.\nPlease follow the steps below to resolve this issue.\n\nSTEP 1:\nContact the client contact noted below for scheduling your inspection and repair. You may contact the client by phone or by replying-all to this email.\n\nWarranty Ticket Details:\n\nTicket #: SUM-EST-0204\n\nClient: Sumit's Test\n\nFacility: Email Subject Test edit\n\nProject: 118 docs\n\nTitle: Perferendis voluptat\n\nDescription: In excepteur aliquid\n\nLocation: Sed sint nihil moles\n\nPriority: Emergency\n\nYou can view the ticket details here:\n\nhttps://sumit-s-test.vueops-qa.com/service_requests/sum-est-0204 ( https://sumit-s-test.vueops-qa.com/service_requests/sum-est-0204 )\n\nFacility Address:\n\nMetro Street\nB 23 Street\nNoida City, NCR State 110092\n\nClient Contact Information\n\nName: Sumit Vueops Account\n\nEmail: sumitka#vueops.com\n\nPhone Number: 999-687-4668\n\nSTEP 2:\nWhen the repair work is complete we ask that you respond to this email with the following information and a photo of the completed work:\n\nWork Performed\n\nRoot Cause:\n\nRepair Date:\n\nThank You,\nPowered by VueOps ( www.vueops.com )\nKnow Your Building Inside OutTM", "from"=>"VueOps Warranty Ticket <service-requests-qa#mg.vueops-qa.com>", "message-headers"=>"[[\"Mime-Version\",\"1.0\"],[\"Content-Type\",\"multipart/alternative; boundary=\\\"0d4b5135bbc71f7078e98fd7ee7355506fb2c219e22a702a301bd7123e55\\\"\"],[\"Subject\",\"Warranty Ticket SUM-EST-0204 for Email Subject Test edit for Sumit's Test has been issued to you for coordination\"],[\"From\",\"VueOps Warranty Ticket <service-requests-qa#mg.vueops-qa.com>\"],[\"To\",\"service-requests-qa#mg.vueops-qa.com\"],[\"In-Reply-To[]\",\"20230113183151.bad48c4ced209202#mg.vueops-qa.com\"],[\"Message-Id\",\"<20230113183151.74967e8866be2d25#mg.vueops-qa.com>\"],[\"Date\",\"Fri, 13 Jan 2023 18:31:51 +0000\"],[\"Sender\",\"service-requests-qa#mg.vueops-qa.com\"]]", "recipient"=>"service-requests-qa#mg.vueops-qa.com", "sender"=>"VueOps Warranty Ticket <service-requests-qa#mg.vueops-qa.com>", "signature"=>"88d9f1b2a5f75668a0436c39050bbccd194485cd4a3b8369d2025311c87c87aa", "stripped-html"=>"<!DOCTYPE html>\n<html>\n<head>\n<meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n<style>body {\nfont-family: 'Calibri', 'Arial', sans-serif;\n}\nimg {\noutline: none; text-decoration: none; -ms-interpolation-mode: bicubic;\n}\n</style>\n</head>\n<body style=\"font-family: 'Calibri', 'Arial', sans-serif;\">\n<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"logo\" width=\"100%\"><tr><td align=\"left\"><img src=\"https://s3-us-west-1.amazonaws.com/dpr-email-assets/VueOPS-logo-full-color-ps.png\" style=\"outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; width: 120px;\"></td></tr></table>\n<p></p>\n<p>\n Hello,\n</p>\n<p class=\"ng-binding\">\n A new Warranty Ticket has been issued for Email Subject Test edit for Sumit's Test.\n <strong>Please follow the steps below to resolve this issue.</strong>\n</p>\n<p>\n <br>\n <strong>STEP 1:</strong>\n Contact the client contact noted below for scheduling your inspection and repair. You may contact the client by phone or by replying-all to this email.\n <br>\n</p>\n<p class=\"ng-binding\">\n <strong style=\"font-size: 1.1em;\">Warranty Ticket Details:</strong>\n <br>\n <strong>Ticket #:</strong> SUM-EST-0204\n <br>\n <strong>Client:</strong> Sumit's Test\n <br>\n <strong>Facility:</strong> Email Subject Test edit\n <br>\n <strong>Project:</strong> 118 docs\n <br>\n <strong>Title:</strong> Perferendis voluptat\n <br>\n <strong>Description:</strong> In excepteur aliquid\n <br>\n <strong>Location:</strong> Sed sint nihil moles\n <br>\n <strong>Priority:</strong> Emergency\n <br>\n <string>You can view the ticket details here:</string>\n <br><br>\n <a ng-href=\"https://sumit-s-test.vueops-qa.com/service_requests/sum-est-0204\" class=\"ng-binding\" href=\"https://sumit-s-test.vueops-qa.com/service_requests/sum-est-0204\" style=\"color: #2e74b5; text-decoration: none;\">https://sumit-s-test.vueops-qa.com/service_requests/sum-est-0204</a>\n <br>\n</p>\n\n<p>\n <strong>Facility Address:</strong>\n <br>\n <span ng-bind-html=\"serviceRequest.formattedFacilityAddress\" class=\"ng-binding\">Metro Street<br>B 23 Street<br>Noida City, NCR State 110092</span>\n <br>\n</p>\n\n<p class=\"ng-binding\">\n <strong>Client Contact Information</strong>\n <br>\n <strong>Name:</strong> Sumit Vueops Account\n <br>\n <strong>Email:</strong> sumitka#vueops.com\n <br>\n <strong>Phone Number:</strong> 999-687-4668\n</p>\n\n<p>\n <strong>STEP 2:</strong>\n When the repair work is complete we ask that you respond to this email with the following information and a photo of the completed work:\n <br>\n</p>\n<p>\n <strong>Work Performed</strong>\n <br>\n <br>\n <strong>Root Cause:</strong>\n <br>\n <strong>Repair Date:</strong>\n</p>\n\n<p>\n \n </p>\n<div class=\"footer\" style=\"font-size: 10pt; font-family: 'FrnkGothITC Bk BT', 'Calibri', 'Arial', sans-serif; color: #999999; letter-spacing: 2pt;\"><p>Thank You, <br>Powered by VueOps<br>Know Your Building Inside Out<sup>TM<sup></sup></sup></p></div>\n</body>\n</html>\n", "stripped-signature"=>"Work Performed\n\nRoot Cause:\n\nRepair Date:\n\nThank You,\nPowered by VueOps ( www.vueops.com )\nKnow Your Building Inside OutTM", "stripped-text"=>"Hello,\n\nA new Warranty Ticket has been issued for Email Subject Test edit for Sumit's Test.\nPlease follow the steps below to resolve this issue.\n\nSTEP 1:\nContact the client contact noted below for scheduling your inspection and repair. You may contact the client by phone or by replying-all to this email.\n\nWarranty Ticket Details:\n\nTicket #: SUM-EST-0204\n\nClient: Sumit's Test\n\nFacility: Email Subject Test edit\n\nProject: 118 docs\n\nTitle: Perferendis voluptat\n\nDescription: In excepteur aliquid\n\nLocation: Sed sint nihil moles\n\nPriority: Emergency\n\nYou can view the ticket details here:\n\nhttps://sumit-s-test.vueops-qa.com/service_requests/sum-est-0204 ( https://sumit-s-test.vueops-qa.com/service_requests/sum-est-0204 )\n\nFacility Address:\n\nMetro Street\nB 23 Street\nNoida City, NCR State 110092\n\nClient Contact Information\n\nName: Sumit Vueops Account\n\nEmail: sumitka#vueops.com\n\nPhone Number: 999-687-4668\n\nSTEP 2:\nWhen the repair work is complete we ask that you respond to this email with the following information and a photo of the completed work:\n", "subject"=>"Warranty Ticket SUM-EST-0204 for Email Subject Test edit for Sumit's Test has been issued to you for coordination", "timestamp"=>"1673638018", "token"=>"90ec0b4c8e14caf44f4bc7259699e8cefdff521b15985ebdfa"}
Please suggest me how to fix this issue.
I'm able to figure out the solution. I'm getting Content-Type application/x-www-form-urlencoded which needs to convert using URI.decode_www_form. Now I'm getting the correct JSON request body.
Related
Remove Hyperlink in Outlook mail template
I want to remove the link like appearance in the below code. For your information this template is being used in outlook <span th:text="${SomeUrl}" th:remove="tag" style="justify-content: normal;width: 100%; word-break: break-all; text-decoration: none;pointer-events: none;cursor: default;"> </span>
laravel blade - how to hide the display of an html element for specific routes
folks! I am using Laravel 5.6 with Hyn Laravel-Tenancy Installed. I have a main menu that is the same for all tenants (subdomains), however, for one or another specific tenant (subdomain), I would like some items to be displayed from that main menu, but for all other tenants, these menu items not visible and also inaccessible, even if called by the url. On the Blade I used a "#if route::has", but even limited that route to a specific subdomain, this route is available for all other subdomains, so that #if receives as true and ends up displaying the menu item. I'm not finding a simple solution, could create a helper that identifies the url and if it is from a specific subdomain, would display the item and for the other subdomains would not be displayed, but "I guess" that it should have a native form using Blade along with "routes\web" to achieve this result. Thanks!!!
use gate and can in laravel in authserviceprovider create a gate like that: $gate->define('see-menu',function(){ //check domains or rules or every thing that you need to check to obtain access //return true if user have access and false if not access }); and in you view use can to check see-menu #can('see-menu') //your code <li class="devider"></li>....... #endcan
u can do it like that i have my routs "admin department listOfTeachers" that thet user can see the button of sidemenu and use it #if(Request::is('admin') || Request::is('department') || Request::is('listOfTeachers')) <div id="mySidenav" class="sidenav"> × <p id="poficon2" style="font-family: AwesomeFont;font-size: 27px; float: right;width:auto;height:auto;padding-left: 15px;padding-right: 20px;" class="colorIcon" id="newbornbaby"></p><p style="font-size: 23px;">الرئيسية</p> <p id="poficon2" style="font-family: AwesomeFont;font-size: 27px; float: right;width:auto;height:auto;padding-left: 15px;padding-right: 20px;" class="colorIcon" id="newbornbaby"></p><p style="font-size: 23px;">قائمة المترشحين</p> <p id="poficon2" style="font-family: AwesomeFont;font-size: 27px; float: right;width:auto;height:auto;padding-left: 15px;padding-right: 20px;" class="colorIcon" id="newbornbaby"></p><p style="font-size: 23px;">قائمة الاساتذة</p> <p id="poficon2" style="font-family: AwesomeFont;font-size: 27px; float: right;width:auto;height:auto;padding-left: 15px;padding-right: 20px;" class="colorIcon" id="newbornbaby"></p><p style="font-size: 23px;">الشعب و التخصصات</p> <p id="poficon2" style="font-family: AwesomeFont;font-size: 27px; float: right;width:auto;height:auto;padding-left: 15px;padding-right: 20px;" class="colorIcon" id="newbornbaby"></p><p style="font-size: 23px;">حسابات العمال</p> </div> <div class="centerVertical" style="float:right;margin-right:1.2rem;" onclick="openNav()"> <img src="../resources/images/menu.png" style="margin-top:3px;float:left;width:27px;height:20px;background-size: contain;background-repeat: no-repeat;" alt="student"> </div> #endif
HTML to PDF using js with utf-8 support
I need to export a web page as pdf it's html content that I display in the browser, I want to give the user the capability to download it as pdf, I tried jsPDF but it doesn't support arabic I need pdf not word, and I need to do it in the client side. please help Thanks in advance,
Demo: http://jsfiddle.net/kumarrishikesh12/rwdL0rxh/ <script async src="//jsfiddle.net/kumarrishikesh12/rwdL0rxh/embed/"></script> OR function doit(){ if (!window.print){ alert("You need NS4.x to use this print button!") return } window.print() } color:#C03; font-size:18px; font-family:"Courier New", Courier, monospace; } p{ font-family:"Comic Sans MS", cursive; font-size:15px; color:#066; text-align:justify;} a{ text-decoration:none; font-size:20px; } <body> <div style="float:right;"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- sidebar300X600 --> <ins class="adsbygoogle" style="display:inline-block;width:300px;height:600px" data-ad-client="ca-pub-1456458421931279" data-ad-slot="1562820743"></ins> </div> <div style="width:500px; height:600px; border:2px #093 dashed; margin:0 auto; padding:10px;"> <h2>What is PHP?</h2> <p>PHP is a server side scripting language commonly used for web applications</p> <h2>How to include a file to a php page?</h2> <p>we can include a file using "include() " or "require()" function with as its parameter..</p> <h2>What's the difference between include and require?</h2> <p>If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.</p> <h2>What Is a Session?</h2> <p>It can be used to store information on the server for future use</p> <h2>How to set cookies in PHP?</h2> <p>Cookies are often used to track user information Syntax: Setcookie(name, value, expire, path, domain); eg:Setcookie("sample", "ram", time()+3600);</p> <div align="center"><img align="middle" border="0" src="http://demos.2my4edge.com/2my4edge-print-page/icon-48-print.png" /> Click here to Print the Page</div> </div> </body>
Image send to email but not attachament, image inputed image from site
I have a contact form and I have some images for every field. When I send email I want to have to email the image of every field, but this show me just link. Here is the code for image: <td rowspan="8" width="44%" style="padding-right: 270px;"><img src="../images/ferestre-fixe/thumb_150_120_03-2.jpg" style="border: 0px none; float: right;" title=""/> <input type="hidden" name="a3cmgif" id="a3cmgif" value="http://<?php echo $_SERVER['SERVER_NAME'];?>/images/ferestre-fixe/thumb_150_120_03-2.jpg" readonly/> </td> OK, we have <input type="hidden" name="a3cmgif" id="a3cmgif" value="http://<?php echo $_SERVER['SERVER_NAME'];?>/images/ferestre-fixe/thumb_150_120_03-2.jpg" readonly/>, but I got to mail http://www.example.com/images/ferestre-fixe/thumb_150_120_03-2.jpg I want to receive to mail directly image. I tried with img src but this send me to mail the code comment.
how to acquire a google authentication token
Retreiving the URL http://www.google.com/reader/api/0/token returns a token, which is periodically updated. What's required to generate this token? Apparently, and I'm guessing a, or some, cookies are accessed by Google for authentication. Here are my results so far: thufir#ARRAKIS:~/projects/curl$ thufir#ARRAKIS:~/projects/curl$ ruby token.rb <html><head><title>403 Forbidden</title> <style type="text/css"> body {font-family: arial,sans-serif} div.nav {margin-top: 1ex} div.nav A {font-size: 10pt; font-family: arial,sans-serif} span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold} div.nav A,span.big {font-size: 12pt; color: #0000cc} div.nav A {font-size: 10pt; color: black} A.l:link {color: #6f6f6f} </style></head> <body text="#000000" bgcolor="#ffffff"><table border="0" cellpadding="2" cellspacing="0" width="100%"></table> <table><tr><td rowspan="3" width="1%"><b><font face="times" color="#0039b6" size="10">G</font><font face="times" color="#c41200" size="10">o</font><font face="times" color="#f3c518" size="10">o</font><font face="times" color="#0039b6" size="10">g</font><font face="times" color="#30a72f" size="10">l</font><font face="times" color="#c41200" size="10">e</font> </b></td> <td> </td></tr> <tr><td bgcolor="#3366cc"><font face="arial,sans-serif" color="#ffffff"><b>Error</b></font></td></tr> <tr><td> </td></tr></table> <blockquote><h1>Forbidden</h1> Your client does not have permission to get URL <code>/reader/api/0/token</code> from this server. <p></p></blockquote> <table width="100%" cellpadding="0" cellspacing="0"><tr><td bgcolor="#3366cc"><img alt="" width="1" height="4"></td></tr></table></body></html> thufir#ARRAKIS:~/projects/curl$ thufir#ARRAKIS:~/projects/curl$ nl token.rb 1 require 'rubygems' 2 require 'curb' 3 token_url = "http://www.google.com/reader/api/0/token" 4 c = Curl::Easy.perform(token_url) 5 puts c.body_str thufir#ARRAKIS:~/projects/curl$
Take a look at the Google Reader API Auth outlined here. ClientLogin is the simpler approach, but OAuth is probably the more robust solution if you want to deploy it for multiple users. Also using OAuth will save you the trouble of dealing with Google user credentials which should be treated carefully.