Skip to main content

Actionable messages

Project description

Actionable messages

MIT License version

  1. Base informations
  2. Installation
  3. Requirements
  4. Usage
  5. AdaptiveCard
  6. MessageCard

Base informations

Playground V2

Send an actionable message via email in Office 365

Outlook version requirements for actionable messages

Installation

pip install git+https://github.com/utsurius/django-actionable-messages

pip install django-actionable-messages

Add "django_actionable_messages" to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    "django_actionable_messages",
]

SETTINGS

ACTIONABLE_MESSAGES = {
    "JSON_ENCODER": None
}

"JSON_ENCODER" is a doted path to custom json encoder.

Requirements

Name Version
python 3.5+
django 1.11.0+

Usage

examples/message_card/github.py

from django_actionable_messages.message_card.actions import OpenUri, HttpPOST, ActionCard
from django_actionable_messages.message_card.cards import MessageCard
from django_actionable_messages.message_card.elements import Fact, ActionTarget
from django_actionable_messages.message_card.inputs import TextInput
from django_actionable_messages.message_card.sections import Section
from django_actionable_messages.message_card.utils import OSType


issue_opened = MessageCard(title="Issue opened: \"Push notifications not working\"", summary="Issue 176715375",
                           theme_color="0078D7")
issue_opened.add_section(
    Section(
        activity_title="Miguel Garcie",
        activity_subtitle="9/13/2016, 11:46am",
        activity_image="https://connectorsdemo.azurewebsites.net/images/MSC12_Oscar_002.jpg",
        text="There is a problem with Push notifications, they don't seem to be picked up by the connector.",
        facts=[
            Fact("Repository:", "mgarcia\\test"),
            Fact("Issue #:", "176715375")
        ]
    )
)
issue_opened.add_actions([
    ActionCard(
        name="Add a comment",
        inputs=[
            TextInput(input_id="comment", title="Enter a comment", is_multiline=True)
        ],
        actions=[
            HttpPOST("OK", target="http://...")
        ]
    ),
    HttpPOST("Close", target="http://..."),
    OpenUri(name="View in Github", targets=[
        ActionTarget(OSType.DEFAULT, "http://...")
    ])
])

examples/adaptive_card/calendar_reminder.py

from django_actionable_messages.adaptive_card.actions import Submit
from django_actionable_messages.adaptive_card.cards import AdaptiveCard
from django_actionable_messages.adaptive_card.elements import TextBlock
from django_actionable_messages.adaptive_card.inputs import InputChoice, ChoiceSetInput
from django_actionable_messages.adaptive_card.utils import SCHEMA, FontSize, FontWeight, SpacingStyle, ChoiceInputStyle


calendar_reminder = AdaptiveCard(version="1.0", schema=SCHEMA)
calendar_reminder.set_speak("Your  meeting about \"Adaptive Card design session\" is starting at 12:30pm"
                            "Do you want to snooze  or do you want to send a late notification to the attendees?")
calendar_reminder.add_element(TextBlock("Adaptive Card design session", size=FontSize.LARGE, weight=FontWeight.BOLDER))
calendar_reminder.add_elements([
    TextBlock("Conf Room 112/3377 (10)", is_subtle=True),
    TextBlock("12:30 PM - 1:30 PM", is_subtle=True, spacing=SpacingStyle.NONE),
    TextBlock("Snooze for")
])
calendar_reminder.add_element(ChoiceSetInput(
    item_id="snooze", style=ChoiceInputStyle.COMPACT, value="5", choices=[
        InputChoice("5 minutes", "5"),
        InputChoice("15 minutes", "15"),
        InputChoice("30 minutes", "30")
    ]
))
calendar_reminder.add_actions([
    Submit(title="Snooze", data={
        "x": "snooze"
    }),
    Submit(title="I'll be late", data={
        "x": "late"
    })
])

For more view examples folder

To get dictionary, json or html payload from card use:

Function Type
.payload dict
.json_payload json string
.html_payload html string - can be used to send card via email (docs)

Problem: '... is not JSON serializable' - probably invalid argument type was used (for example: custom object or lazy object instead of str).

Solution: Better Python Object Serialization

You can set JSON_ENCODER (globally) in SETTINGS(ACTIONABLE_MESSAGES) or set it by card(json_encoder):

from django_actionable_messages.adaptive_card.cards import AdaptiveCard


class MyAdaptiveCard(AdaptiveCard):
    json_encoder = "path.to.my.encoder"

or

from django_actionable_messages.adaptive_card.cards import AdaptiveCard


class MyAdaptiveCard(AdaptiveCard):
    json_encoder = MyJSONEncoder

Send MessageCard to msteams using webhooks and requests library:

import requests


requests.post(
    webhook_url,
    json=card.payload,
    headers={
        "Content-Type": "application/json; charset=utf-8"
    }
)

To get/add webhook_url see here: Get the Microsoft Teams webhook URL, Create and add an outgoing webhook in Teams

AdaptiveCard

Supported versions: 1.0, 1.1, 1.2

Schema Explorer

Elements

src: from django_actionable_messages.adaptive_card.elements import ...

TextBlock (docs)

Argument name Function Property Type
text set_text() text str
color set_color() color Color1
font_type set_font_type() fontType FontType1
horizontal_alignment set_horizontal_alignment() horizontalAlignment HorizontalAlignment1
is_subtle set_is_subtle() isSubtle bool
max_lines set_max_lines() maxLines int
size set_size() size FontSize1
weight set_weight() weight FontWeight1
wrap set_wrap() wrap bool
fallback set_fallback() fallback FallbackOption1 or card element2
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle1
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight1

[1] from django_actionable_messages.adaptive_cards.utils import ...

[2]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

Image (docs)

Argument name Function Property Type
url set_url() url str
alternate_text set_alternate_text() altText str
background_color set_background_color() backgroundColor str
height set_height() height str or BlockElementHeight1
horizontal_alignment set_horizontal_alignment() horizontalAlignment HorizontalAlignment1
select_action set_select_action() selectAction see docs
size set_size() size ImageSize1
style set_style() style ImageStyle1
width set_width() width str
fallback set_fallback() fallback FallbackOption1 or card element2
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle1
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight1

[1] from django_actionable_messages.adaptive_cards.utils import ...

[2]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

MediaSource (docs)

Argument name Property Type
mime_type mimeType str
url url str

Media (docs)

Argument name Function Property Type
sources add_sources() sources list of MediaSource(s)1
poster set_poster() poster str
alternate_text set_alternate_text() altText str
fallback set_fallback() fallback FallbackOption2 or card element3
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle2
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight2

Other functions

Name Property Type
add_source() sources MediaSource1

[1] from django_actionable_messages.adaptive_cards.elements import ...

[2] from django_actionable_messages.adaptive_cards.utils import ...

[3]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

TextRun (docs)

Argument name Function Property Type
text set_text() text str
color set_color() color Color1
font_type set_font_type() fontType FontType1
highlight set_highlight() highlight bool
is_subtle set_is_subtle() isSubtle bool
italic set_italic() italic bool
select_action set_select_action() selectAction see docs
size set_size() fontSize FontSize1
strike_through set_strike_through() strikethrough bool
weight set_weight() fontWeight FontWeight1

[1] from django_actionable_messages.adaptive_cards.utils import ...

RichTextBlock (docs)

Argument name Function Property Type
inlines set_inlines() inlines str, TextRun1
horizontal_alignment set_horizontal_alignment() horizontalAlignment HorizontalAlignment1
fallback set_fallback() fallback FallbackOption2 or card element3
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle2
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight1

[1] from django_actionable_messages.adaptive_cards.elements import ...

[2] from django_actionable_messages.adaptive_cards.utils import ...

[3]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

Inputs

src: from django_actionable_messages.adaptive_card.inputs import ...

TextInput (docs)

Argument name Function Property Type
is_multiline set_is_multiline() isMultiline bool
max_length set_max_length() maxLength int
placeholder set_placeholder() placeholder str
style set_style() style TextInputStyle1
inline_action set_inline_action() inlineAction see docs
value set_value() value str
fallback set_fallback() fallback FallbackOption1 or card element2
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle1
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight1

[1] from django_actionable_messages.adaptive_cards.utils import ...

[2]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

NumberInput (docs)

Argument name Function Property Type
max_value set_max_value() maxValue int
min_value set_min_value() minValue int
placeholder set_placeholder() placeholder str
value set_value() value int
fallback set_fallback() fallback FallbackOption1 or card element2
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle1
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight1

[1] from django_actionable_messages.adaptive_cards.utils import ...

[2]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

DateInput (docs)

Argument name Function Property Type
max_value set_max_value() maxValue str
min_value set_min_value() minValue str
placeholder set_placeholder() placeholder str
value set_value() value str
fallback set_fallback() fallback FallbackOption1 or card element2
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle1
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight1

[1] from django_actionable_messages.adaptive_cards.utils import ...

[2]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

TimeInput (docs)

Argument name Function Property Type
max_value set_max_value() maxValue str
min_value set_min_value() minValue str
placeholder set_placeholder() placeholder str
value set_value() value str
fallback set_fallback() fallback FallbackOption1 or card element2
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle1
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight1

[1] from django_actionable_messages.adaptive_cards.utils import ...

[2]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

ToggleInput (docs)

Argument name Function Property Type
title set_title() title str
value set_value() value str
value_off set_value_off() valueOff str
value_on set_value_on() valueOn str
wrap set_wrap() wrap bool
fallback set_fallback() fallback FallbackOption1 or card element2
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle1
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight1

[1] from django_actionable_messages.adaptive_cards.utils import ...

[2]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

InputChoice (docs)

Argument name Property Type
title title str
value value str, int

ChoiceSetInput (docs)

Argument name Function Property Type
choices set_choices() choices list of InputChoice(s)1
is_multi_select set_is_multi_select() isMultiSelect bool
style set_style() style ChoiceInputStyle2
value set_value() value str
wrap set_wrap() wrap bool
fallback set_fallback() fallback FallbackOption2 or card element3
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle2
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight2

[1] from django_actionable_messages.adaptive_cards.inputs import ...

[2] from django_actionable_messages.adaptive_cards.utils import ...

[3]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

Actions

src: from django_actionable_messages.adaptive_card.actions import ...

OpenUrl (docs)

Argument name Function Property Type
url set_url() url str
title set_title() title str
icon_url set_icon_url() iconUrl str
style set_style() style ActionStyle2
item_id set_id() id str
fallback set_fallback() fallback FallbackOption2 or action1(except TargetElement1)
requires set_requires() requires dict

[1] from django_actionable_messages.adaptive_cards.actions import ...

[2] from django_actionable_messages.adaptive_cards.utils import ...

Submit (docs)

Argument name Function Property Type
data set_data() data str, dict
title set_title() title str
icon_url set_icon_url() iconUrl str
style set_style() style ActionStyle2
item_id set_id() id str
fallback set_fallback() fallback FallbackOption2 or action1(except TargetElement1)
requires set_requires() requires dict

[1] from django_actionable_messages.adaptive_cards.actions import ...

[2] from django_actionable_messages.adaptive_cards.utils import ...

ShowCard (docs)

Argument name Function Property Type
card set_card() card AdaptiveCard2
title set_title() title str
icon_url set_icon_url() iconUrl str
style set_style() style ActionStyle3
item_id set_id() id str
fallback set_fallback() fallback FallbackOption3 or action1(except TargetElement1)
requires set_requires() requires dict

[1] from django_actionable_messages.adaptive_cards.actions import ...

[2] from django_actionable_messages.adaptive_cards.cards import ...

[3] from django_actionable_messages.adaptive_cards.utils import ...

TargetElement (docs)

Argument name Function Property Type
element_id set_element_id() elementId str
is_visible set_is_visible() isVisible bool

ToggleVisibility (docs)

Argument name Function Property Type
target_elements set_target_elements() targetElements list of TargetElement1/str (can be mixed)
title set_title() title str
icon_url set_icon_url() iconUrl str
style set_style() style ActionStyle2
item_id set_id() id str
fallback set_fallback() fallback FallbackOption1 or action1(except TargetElement1)
requires set_requires() requires dict

[1] from django_actionable_messages.adaptive_cards.actions import ...

[2] from django_actionable_messages.adaptive_cards.utils import ...

Containers

src: from django_actionable_messages.adaptive_card.containers import ...

ActionSet (docs)

Argument name Function Property Type
actions add_actions() actions list of actions(see docs)
fallback set_fallback() fallback FallbackOption1 or card element2
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle1
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight1

Other functions

Name Property Type
add_action() actions see docs

[1] from django_actionable_messages.adaptive_cards.utils import ...

[2]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

Container (docs)

Argument name Function Property Type
items add_items() items see docs
select_action set_select_action() selectAction any action(see docs)
style set_style() style Style2
vertical_content_alignment set_vertical_content_alignment() verticalContentAlignment VerticalAlignment2
bleed set_bleed() bleed bool
background_image set_background_image() backgroundImage BackgroundImage1
min_height set_min_height() minHeight str
fallback set_fallback() fallback FallbackOption2 or card element3
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle2
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight2

Other functions

Name Property Type
add_item() items see docs

[1] from django_actionable_messages.adaptive_cards.types import ...

[2] from django_actionable_messages.adaptive_cards.utils import ...

[3]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

Column (docs)

Argument name Function Property Type
items add_items() items list (see docs)
background_image set_background_image() backgroundImage str, BackgroundImage2
bleed set_bleed() bleed bool
fallback set_fallback() fallback FallbackOption3 or Column1
min_height set_min_height() minHeight str
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle3
select_action set_select_action() selectAction see docs
style set_style() style Style3
vertical_content_alignment set_vertical_content_alignment() verticalContentAlignment VerticalAlignment3
width set_width() width str, int, Width3
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict

[1] from django_actionable_messages.adaptive_cards.containers import ...

[2] from django_actionable_messages.adaptive_cards.types import ...

[3] from django_actionable_messages.adaptive_cards.utils import ...

ColumnSet (docs)

Argument name Function Property Type
columns add_columns() columns list of Column(s)1
select_action set_select_action() selectAction see docs
style set_style() style Style2
bleed set_bleed() bleed bool
min_height set_min_height() minHeight str
fallback set_fallback() fallback FallbackOption2 or card element3
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle2
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight2

Other functions

Name Property Type
add_column() columns Column1

[1] from django_actionable_messages.adaptive_cards.containers import ...

[2] from django_actionable_messages.adaptive_cards.utils import ...

[3]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

Fact (docs)

Argument name Property Type
title title str
value value str

FactSet (docs)

Argument name Function Property Type
facts add_facts() facts list of Fact(s)1
fallback set_fallback() fallback FallbackOption2 or card element3
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle2
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight2

Other functions

Name Property Type
add_fact() facts Fact1

[1] from django_actionable_messages.adaptive_cards.containers import ...

[2] from django_actionable_messages.adaptive_cards.utils import ...

[3]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

ImageSet (docs)

Argument name Function Property Type
images add_images() images list of Image(s)1
image_size set_image_size() imageSize ImageSize2
fallback set_fallback() fallback FallbackOption2 or card element3
separator set_separator() separator bool
spacing set_spacing() spacing SpacingStyle2
item_id set_id() id str
is_visible set_is_visible() isVisible bool
requires set_requires() requires dict
height set_height() height BlockElementHeight2

Other functions

Name Property Type
add_image() images Image1

[1] from django_actionable_messages.adaptive_cards.elements import ...

[2] from django_actionable_messages.adaptive_cards.utils import ...

[3]

Type All except Import
containers Fact, Column from django_actionable_messages.adaptive_cards.containers import ...
elements MediaSource, TextRun from django_actionable_messages.adaptive_cards.elements import ...
inputs InputChoice from django_actionable_messages.adaptive_cards.inputs import ...

Types

src: from django_actionable_messages.adaptive_card.types import ...

BackgroundImage (docs)

Argument name Function Property Type
url set_url() url str
fill_mode set_fill_mode() fillMode FillMode1
horizontal_alignment set_horizontal_alignment() horizontalAlignment HorizontalAlignment1
vertical_alignment set_vertical_alignment() verticalAlignment VerticalAlignment1

[1] from django_actionable_messages.adaptive_cards.utils import ...

Cards

src: from django_actionable_messages.adaptive_card.cards import ...

AdaptiveCard (docs)

Argument name Function Property Type
version set_version() version str, SCHEMA1
schema set_schema() $schema str
inputs add_elements() inputs list of inputs(see docs)
actions add_actions() actions list of actions(see docs)
select_action set_select_action() selectAction see docs
style set_style() style Style1
hide_original_body set_hide_original_body() hideOriginalBody bool
fallback_text set_fallback_text() fallbackText str
background_image set_background_image() backgroundImage str, Image2
min_height set_min_height() minHeight str
speak set_speak() speak str
lang set_lang() lang str
vertical_content_alignment set_vertical_content_alignment() verticalContentAlignment VerticalAlignment1

AdaptiveCard also have other functions:

Name Property Type
add_element() body any input(see docs)
add_action() actions any action(see docs)

[1] from django_actionable_messages.adaptive_cards.utils import ...

[2] from django_actionable_messages.adaptive_cards.elements import ...

MessageCard

Legacy actionable message card reference

Elements

src: from django_actionable_messages.message_card.elements import ...

Header (docs)

Argument name Property Type
name name str
value value str, int

Fact

Argument name Property Type
name name str
value value str

HeroImage (docs)

Argument name Function Property Type
url set_url() image str
title set_title() title str

InputChoice

Argument name Property Type
name display str
value value str, int

ActionTarget

Argument name Property Type
os_type os OSType1
url uri str

[1] from django_actionable_messages.message_cards.utils import ...

Inputs

src: from django_actionable_messages.message_card.inputs import ...

TextInput (docs)

Argument name Function Property Type
max_length set_max_length() maxLength int
is_multiline set_is_multiline() isMultiline bool
input_id set_id() id str
title set_title() title str
value set_value() value str
is_required set_is_required() isRequired bool

DateInput (docs)

Argument name Function Property Type
include_time set_include_time() maxLength bool
input_id set_id() id str
title set_title() title str
value set_value() value str
is_required set_is_required() isRequired bool

MultiChoiceInput (docs)

Argument name Function Property Type
choices add_choices() choices list of InputChoice(s)1
is_multi_select set_is_multi_select() isMultiSelect bool
style set_style() style ChoiceStyle2
input_id set_id() id str
title set_title() title str
value set_value() value str
is_required set_is_required() isRequired bool

Other functions

Name Property Type
add_choice() choices InputChoice1

[1] from django_actionable_messages.message_cards.inputs import ...

[2] from django_actionable_messages.message_cards.utils import ...

Actions

src: from django_actionable_messages.message_card.actions import ...

OpenUri (docs)

Argument name Function Property Type
name set_name() name str
targets add_targets() targets list of ActionTarget1

Other functions

Name Property Type
add_target() targets ActionTarget1

[1] from django_actionable_messages.message_cards.elements import ...

HttpPOST (docs)

Argument name Function Property Type
name set_name() name str
target set_target() targets str
headers add_headers() headers list of Header(s)1
body set_body() body str
body_content_type set_body_content_type() bodyContentType str

Other functions

Name property Type
add_header() headers Header1

[1] from django_actionable_messages.message_cards.elements import ...

InvokeAddInCommand (docs)

Argument name Function Property Type
name set_name() name str
add_in_id set_add_in_id() addInId str
desktop_command_id set_desktop_command_id() desktopCommandId str
initialization_context set_set_initialization_context() initializationContext dict

ActionCard (docs)

Argument name Function Property Type
name set_name() name str
inputs add_inputs() inputs list of inputs(see docs)
actions add_actions() actions list of actions(see docs)

Other functions

Name Property Type
add_input() inputs see docs
add_action() actions see docs

Sections

src: from django_actionable_messages.message_card.sections import ...

Section (docs)

Argument name Function Property Type
start_group set_start_group() startGroup bool
title set_title() title str
text set_text() text str
activity_image set_activity_image() activityImage str
activity_title set_activity_title() activityTitle str
activity_subtitle set_activity_subtitle() activitySubtitle str
activity_text set_activity_text() activityText str
hero_image set_hero_image() heroImage HeroImage1
facts add_facts() facts list of Fact(s)1
actions add_potential_actions() potentialAction list of actions(see docs)

Other functions:

Name Property Type
set_activity(image, title, subtitle, text) activityImage, activityTitle, activitySubtitle, activityText str
add_fact() facts Fact1
add_action() potentialAction any action(see docs)

[1] from django_actionable_messages.message_cards.elements import ...

Cards

src: from django_actionable_messages.message_card.cards import ...

MessageCard

Argument name Function Property Type
title set_title() title str
text set_text() text str
originator set_originator() originator str
summary set_summary() summary str
theme_color set_theme_color() themeColor str
correlation_id set_correlation_id() correlationId str
auto_correlation_id* - correlationId bool (default: True)
expected_actors set_expected_actors() expectedActors list of emails
hide_original_body set_hide_original_body() hideOriginalBody bool
sections add_sections() sections list of Section(s)1
actions add_actions() potentialAction list of actions(see docs)

Other functions:

Name Property Type
add_section() sections Section1
add_action() potentialAction any action(see docs)

[1] from django_actionable_messages.message_cards.sections import ...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_actionable_messages-0.1.1.tar.gz (29.0 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page