Exemple #1
0
        public dupBubbleMulticastNoFooter SetBubbleMessageMultiCastNoFooter(string strMessage, string appNo, string headerDefault = "แจ้งเตือนงานใหม่!", string textcolor = "#FFFFFFFF")
        {
            dupBubbleMulticastNoFooter main           = new dupBubbleMulticastNoFooter();
            dupBubbleSubMain           subMain        = new dupBubbleSubMain();
            dupBubbleTemplate          template       = new dupBubbleTemplate();
            dupBubbleHeader            header         = new dupBubbleHeader();
            dupBubbleHeaderContents    headerContents = new dupBubbleHeaderContents();
            dupBubbleHero           hero           = new dupBubbleHero();
            dupBubbleBody           body           = new dupBubbleBody();
            dupBubbleContents       contents       = new dupBubbleContents();
            dupBubbleFooterContents footerContents = new dupBubbleFooterContents();

            subMain.type    = "flex";
            subMain.altText = headerDefault;

            template.type           = "bubble";
            header.type             = "box";
            header.layout           = "horizontal";
            header.position         = "relative";
            header.backgroundColor  = "#20409A";
            headerContents.type     = "text";
            headerContents.text     = headerDefault;
            headerContents.weight   = "bold";
            headerContents.size     = "lg";
            headerContents.color    = textcolor;
            headerContents.contents = new List <object>();

            header.contents.Add(headerContents);

            hero.type         = "image";
            hero.url          = "https://www.nextcapital.co.th/uploads/06F1/files/b0b78757ee3181d6ce333da2a31128ec.png";
            hero.size         = "full";
            hero.aspectRatio  = "16:8";
            hero.aspectMode   = "cover";
            hero.action.type  = "uri";
            hero.action.label = "Action";
            hero.action.uri   = "https://www.nextcapital.co.th";
            body.type         = "box";
            body.layout       = "horizontal";
            body.spacing      = "md";
            contents.type     = "text";
            contents.text     = strMessage;
            contents.weight   = "regular";
            contents.wrap     = true;
            contents.style    = "normal";
            contents.contents = new List <object>();

            body.contents.Add(contents);

            template.header  = header;
            template.hero    = hero;
            template.body    = body;
            subMain.contents = template;
            main.messages.Add(subMain);

            return(main);
        }
Exemple #2
0
        public dupBubbleMain SetBubbleMessage(string strMessage)
        {
            dupBubbleMain           main           = new dupBubbleMain();
            dupBubbleSubMain        subMain        = new dupBubbleSubMain();
            dupBubbleTemplate       template       = new dupBubbleTemplate();
            dupBubbleHeader         header         = new dupBubbleHeader();
            dupBubbleHeaderContents headerContents = new dupBubbleHeaderContents();
            dupBubbleHero           hero           = new dupBubbleHero();
            dupBubbleBody           body           = new dupBubbleBody();
            dupBubbleContents       contents       = new dupBubbleContents();
            dupBubbleFooter         footer         = new dupBubbleFooter();
            dupBubbleFooterContents footerContents = new dupBubbleFooterContents();

            subMain.type    = "flex";
            subMain.altText = "This is a Flex Message";

            template.type           = "bubble";
            header.type             = "box";
            header.layout           = "horizontal";
            header.position         = "relative";
            header.backgroundColor  = "#20409A";
            headerContents.type     = "text";
            headerContents.text     = "รายละเอียดสินเชื่อ";
            headerContents.weight   = "bold";
            headerContents.size     = "lg";
            headerContents.color    = "#FFFFFFFF";
            headerContents.contents = new List <object>();

            header.contents.Add(headerContents);

            hero.type         = "image";
            hero.url          = "https://www.nextcapital.co.th/uploads/06F1/files/b0b78757ee3181d6ce333da2a31128ec.png";
            hero.size         = "full";
            hero.aspectRatio  = "16:8";
            hero.aspectMode   = "cover";
            hero.action.type  = "uri";
            hero.action.label = "Action";
            hero.action.uri   = "https://www.nextcapital.co.th";
            body.type         = "box";
            body.layout       = "horizontal";
            body.spacing      = "md";
            contents.type     = "text";
            contents.text     = strMessage;
            contents.weight   = "regular";
            contents.wrap     = true;
            contents.style    = "normal";
            contents.contents = new List <object>();

            body.contents.Add(contents);

            footer.type                 = "box";
            footer.layout               = "horizontal";
            footer.backgroundColor      = "#FDB813";
            footerContents.type         = "button";
            footerContents.action.type  = "message";
            footerContents.action.label = "ดูช่องทางชำระเงิน";
            footerContents.action.text  = "ช่องทางชำระเงิน";
            footerContents.color        = "#20409A";
            //footerContents.color = "#FDB813";
            footerContents.style = "link";

            footer.contents.Add(footerContents);

            template.header  = header;
            template.hero    = hero;
            template.body    = body;
            template.footer  = footer;
            subMain.contents = template;
            main.messages.Add(subMain);

            return(main);
        }