Skip to content
v2.278.0

CampaignInAppMessageProperty Struct ​

Specifies the appearance of an in-app message, including the message type, the title and body text, text and background colors, and the configurations of buttons that appear in the message.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_pinpoint as pinpoint } from 'aws-cdk-lib';

declare const customConfig: any;
const campaignInAppMessageProperty: pinpoint.CfnCampaign.CampaignInAppMessageProperty = {
  content: [{
    backgroundColor: 'backgroundColor',
    bodyConfig: {
      alignment: 'alignment',
      body: 'body',
      textColor: 'textColor',
    },
    headerConfig: {
      alignment: 'alignment',
      header: 'header',
      textColor: 'textColor',
    },
    imageUrl: 'imageUrl',
    primaryBtn: {
      android: {
        buttonAction: 'buttonAction',
        link: 'link',
      },
      defaultConfig: {
        backgroundColor: 'backgroundColor',
        borderRadius: 123,
        buttonAction: 'buttonAction',
        link: 'link',
        text: 'text',
        textColor: 'textColor',
      },
      ios: {
        buttonAction: 'buttonAction',
        link: 'link',
      },
      web: {
        buttonAction: 'buttonAction',
        link: 'link',
      },
    },
    secondaryBtn: {
      android: {
        buttonAction: 'buttonAction',
        link: 'link',
      },
      defaultConfig: {
        backgroundColor: 'backgroundColor',
        borderRadius: 123,
        buttonAction: 'buttonAction',
        link: 'link',
        text: 'text',
        textColor: 'textColor',
      },
      ios: {
        buttonAction: 'buttonAction',
        link: 'link',
      },
      web: {
        buttonAction: 'buttonAction',
        link: 'link',
      },
    },
  }],
  customConfig: customConfig,
  layout: 'layout',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_pinpoint as pinpoint

# custom_config: Any

campaign_in_app_message_property = pinpoint.CfnCampaign.CampaignInAppMessageProperty(
    content=[pinpoint.CfnCampaign.InAppMessageContentProperty(
        background_color="backgroundColor",
        body_config=pinpoint.CfnCampaign.InAppMessageBodyConfigProperty(
            alignment="alignment",
            body="body",
            text_color="textColor"
        ),
        header_config=pinpoint.CfnCampaign.InAppMessageHeaderConfigProperty(
            alignment="alignment",
            header="header",
            text_color="textColor"
        ),
        image_url="imageUrl",
        primary_btn=pinpoint.CfnCampaign.InAppMessageButtonProperty(
            android=pinpoint.CfnCampaign.OverrideButtonConfigurationProperty(
                button_action="buttonAction",
                link="link"
            ),
            default_config=pinpoint.CfnCampaign.DefaultButtonConfigurationProperty(
                background_color="backgroundColor",
                border_radius=123,
                button_action="buttonAction",
                link="link",
                text="text",
                text_color="textColor"
            ),
            ios=pinpoint.CfnCampaign.OverrideButtonConfigurationProperty(
                button_action="buttonAction",
                link="link"
            ),
            web=pinpoint.CfnCampaign.OverrideButtonConfigurationProperty(
                button_action="buttonAction",
                link="link"
            )
        ),
        secondary_btn=pinpoint.CfnCampaign.InAppMessageButtonProperty(
            android=pinpoint.CfnCampaign.OverrideButtonConfigurationProperty(
                button_action="buttonAction",
                link="link"
            ),
            default_config=pinpoint.CfnCampaign.DefaultButtonConfigurationProperty(
                background_color="backgroundColor",
                border_radius=123,
                button_action="buttonAction",
                link="link",
                text="text",
                text_color="textColor"
            ),
            ios=pinpoint.CfnCampaign.OverrideButtonConfigurationProperty(
                button_action="buttonAction",
                link="link"
            ),
            web=pinpoint.CfnCampaign.OverrideButtonConfigurationProperty(
                button_action="buttonAction",
                link="link"
            )
        )
    )],
    custom_config=custom_config,
    layout="layout"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.pinpoint.*;

Object customConfig;

CampaignInAppMessageProperty campaignInAppMessageProperty = CampaignInAppMessageProperty.builder()
        .content(List.of(InAppMessageContentProperty.builder()
                .backgroundColor("backgroundColor")
                .bodyConfig(InAppMessageBodyConfigProperty.builder()
                        .alignment("alignment")
                        .body("body")
                        .textColor("textColor")
                        .build())
                .headerConfig(InAppMessageHeaderConfigProperty.builder()
                        .alignment("alignment")
                        .header("header")
                        .textColor("textColor")
                        .build())
                .imageUrl("imageUrl")
                .primaryBtn(InAppMessageButtonProperty.builder()
                        .android(OverrideButtonConfigurationProperty.builder()
                                .buttonAction("buttonAction")
                                .link("link")
                                .build())
                        .defaultConfig(DefaultButtonConfigurationProperty.builder()
                                .backgroundColor("backgroundColor")
                                .borderRadius(123)
                                .buttonAction("buttonAction")
                                .link("link")
                                .text("text")
                                .textColor("textColor")
                                .build())
                        .ios(OverrideButtonConfigurationProperty.builder()
                                .buttonAction("buttonAction")
                                .link("link")
                                .build())
                        .web(OverrideButtonConfigurationProperty.builder()
                                .buttonAction("buttonAction")
                                .link("link")
                                .build())
                        .build())
                .secondaryBtn(InAppMessageButtonProperty.builder()
                        .android(OverrideButtonConfigurationProperty.builder()
                                .buttonAction("buttonAction")
                                .link("link")
                                .build())
                        .defaultConfig(DefaultButtonConfigurationProperty.builder()
                                .backgroundColor("backgroundColor")
                                .borderRadius(123)
                                .buttonAction("buttonAction")
                                .link("link")
                                .text("text")
                                .textColor("textColor")
                                .build())
                        .ios(OverrideButtonConfigurationProperty.builder()
                                .buttonAction("buttonAction")
                                .link("link")
                                .build())
                        .web(OverrideButtonConfigurationProperty.builder()
                                .buttonAction("buttonAction")
                                .link("link")
                                .build())
                        .build())
                .build()))
        .customConfig(customConfig)
        .layout("layout")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Pinpoint;

var customConfig;

var campaignInAppMessageProperty = new CampaignInAppMessageProperty {
    Content = new [] { new InAppMessageContentProperty {
        BackgroundColor = "backgroundColor",
        BodyConfig = new InAppMessageBodyConfigProperty {
            Alignment = "alignment",
            Body = "body",
            TextColor = "textColor"
        },
        HeaderConfig = new InAppMessageHeaderConfigProperty {
            Alignment = "alignment",
            Header = "header",
            TextColor = "textColor"
        },
        ImageUrl = "imageUrl",
        PrimaryBtn = new InAppMessageButtonProperty {
            Android = new OverrideButtonConfigurationProperty {
                ButtonAction = "buttonAction",
                Link = "link"
            },
            DefaultConfig = new DefaultButtonConfigurationProperty {
                BackgroundColor = "backgroundColor",
                BorderRadius = 123,
                ButtonAction = "buttonAction",
                Link = "link",
                Text = "text",
                TextColor = "textColor"
            },
            Ios = new OverrideButtonConfigurationProperty {
                ButtonAction = "buttonAction",
                Link = "link"
            },
            Web = new OverrideButtonConfigurationProperty {
                ButtonAction = "buttonAction",
                Link = "link"
            }
        },
        SecondaryBtn = new InAppMessageButtonProperty {
            Android = new OverrideButtonConfigurationProperty {
                ButtonAction = "buttonAction",
                Link = "link"
            },
            DefaultConfig = new DefaultButtonConfigurationProperty {
                BackgroundColor = "backgroundColor",
                BorderRadius = 123,
                ButtonAction = "buttonAction",
                Link = "link",
                Text = "text",
                TextColor = "textColor"
            },
            Ios = new OverrideButtonConfigurationProperty {
                ButtonAction = "buttonAction",
                Link = "link"
            },
            Web = new OverrideButtonConfigurationProperty {
                ButtonAction = "buttonAction",
                Link = "link"
            }
        }
    } },
    CustomConfig = customConfig,
    Layout = "layout"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var customConfig interface{}

campaignInAppMessageProperty := &CampaignInAppMessageProperty{
	Content: []interface{}{
		&InAppMessageContentProperty{
			BackgroundColor: jsii.String("backgroundColor"),
			BodyConfig: &InAppMessageBodyConfigProperty{
				Alignment: jsii.String("alignment"),
				Body: jsii.String("body"),
				TextColor: jsii.String("textColor"),
			},
			HeaderConfig: &InAppMessageHeaderConfigProperty{
				Alignment: jsii.String("alignment"),
				Header: jsii.String("header"),
				TextColor: jsii.String("textColor"),
			},
			ImageUrl: jsii.String("imageUrl"),
			PrimaryBtn: &InAppMessageButtonProperty{
				Android: &OverrideButtonConfigurationProperty{
					ButtonAction: jsii.String("buttonAction"),
					Link: jsii.String("link"),
				},
				DefaultConfig: &DefaultButtonConfigurationProperty{
					BackgroundColor: jsii.String("backgroundColor"),
					BorderRadius: jsii.Number(123),
					ButtonAction: jsii.String("buttonAction"),
					Link: jsii.String("link"),
					Text: jsii.String("text"),
					TextColor: jsii.String("textColor"),
				},
				Ios: &OverrideButtonConfigurationProperty{
					ButtonAction: jsii.String("buttonAction"),
					Link: jsii.String("link"),
				},
				Web: &OverrideButtonConfigurationProperty{
					ButtonAction: jsii.String("buttonAction"),
					Link: jsii.String("link"),
				},
			},
			SecondaryBtn: &InAppMessageButtonProperty{
				Android: &OverrideButtonConfigurationProperty{
					ButtonAction: jsii.String("buttonAction"),
					Link: jsii.String("link"),
				},
				DefaultConfig: &DefaultButtonConfigurationProperty{
					BackgroundColor: jsii.String("backgroundColor"),
					BorderRadius: jsii.Number(123),
					ButtonAction: jsii.String("buttonAction"),
					Link: jsii.String("link"),
					Text: jsii.String("text"),
					TextColor: jsii.String("textColor"),
				},
				Ios: &OverrideButtonConfigurationProperty{
					ButtonAction: jsii.String("buttonAction"),
					Link: jsii.String("link"),
				},
				Web: &OverrideButtonConfigurationProperty{
					ButtonAction: jsii.String("buttonAction"),
					Link: jsii.String("link"),
				},
			},
		},
	},
	CustomConfig: customConfig,
	Layout: jsii.String("layout"),
}

Properties ​

contentoptionalIResolvable | IResolvable | CfnCampaign.InAppMessageContentProperty[]contentoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, InAppMessageContentProperty]]]contentoptionalIResolvableContentoptionalIResolvableContentoptionalinterface{} #
An array that contains configurtion information about the in-app message for the campaign, including title and body text, text colors, background colors, image URLs, and button configurations.
customConfigoptionalanycustom_configoptionalAnycustomConfigoptionalObjectCustomConfigoptionalobjectCustomConfigoptionalinterface{} #
Custom data, in the form of key-value pairs, that is included in an in-app messaging payload.
layoutoptionalstringlayoutoptionalstrlayoutoptionalStringLayoutoptionalstringLayoutoptional*string #
A string that describes how the in-app message will appear. You can specify one of the following:.
notes
  • BOTTOM_BANNER – a message that appears as a banner at the bottom of the page.
  • TOP_BANNER – a message that appears as a banner at the top of the page.
  • OVERLAYS – a message that covers entire screen.
  • MOBILE_FEED – a message that appears in a window in front of the page.
  • MIDDLE_BANNER – a message that appears as a banner in the middle of the page.
  • CAROUSEL – a scrollable layout of up to five unique messages.