Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement Request - Add support for message summary #13

Open
orihartstein opened this issue Aug 1, 2018 · 3 comments
Open

Enhancement Request - Add support for message summary #13

orihartstein opened this issue Aug 1, 2018 · 3 comments

Comments

@orihartstein
Copy link

orihartstein commented Aug 1, 2018

In many cases a header is not needed for the message - today webhooks require either text or summary property for each message.

using summary property allows to remove the header and the summary will not be shown.

class connectorcard:

def text(self, mtext):
	self.payload["text"] = mtext

def title(self, mtitle):
	self.payload["title"] = mtitle
	
def summary(self,msummary):
	self.payload["summary"] = msummary
@rveachkc
Copy link
Owner

rveachkc commented Aug 3, 2018

I tried a code modification, and could not see the summary appear on the teams card message.

image

Are you expecting to see the summary somewhere else?

>>> import pymsteams
>>> m = pymsteams.connectorcard(my_url)
>>> m.summary("test summary")
>>> m.title("test title")
>>> m.text("slkfjslkdfj ljsdflksjdf lksjdflskdjf  lksjdflksjdf  lkjsdflkjsdf lkjsdflksjdf  lskdjflskdjfsldf lkjsdflksdjflsdkjf  lkjsdflksdjf sldflkjsdf lksdjf lsdkjf sldkjf slkjf slkjf lskdjf lskj flsdkj f")
>>> m.send()
True
>>> pprint.pprint(m.payload)
{'summary': 'test summary',
 'text': 'slkfjslkdfj ljsdflksjdf lksjdflskdjf  lksjdflksjdf  lkjsdflkjsdf '
         'lkjsdflksjdf  lskdjflskdjfsldf lkjsdflksdjflsdkjf  lkjsdflksdjf '
         'sldflkjsdf lksdjf lsdkjf sldkjf slkjf slkjf lskdjf lskj flsdkj f',
 'title': 'test title'}

Source

@orihartstein
Copy link
Author

orihartstein commented Aug 4, 2018

I think, that text property is meant to visible as a text header for the message.
if you don't want a header you can populate summary property - which is not visible.

so you fill text if you want visible and summary if you don't.

sample will give a card without header text

message.summary("this text is not visible")
messageSection = pymsteams.cardsection()

messageSection.title("Section title")
messageSection.activityTitle("my activity title {}".format( now ))
messageSection.activitySubtitle("my activity subtitle")
messageSection.activityImage("http://www.clker.com/cliparts/v/u/z/w/n/2/thumbsup-md.png")
messageSection.activityText("This is my activity Text")
messageSection.addFact("this", "is fine")
messageSection.addFact("this is", "also fine")
messageSection.text("This is my section text")

image

@rveachkc
Copy link
Owner

rveachkc commented Nov 2, 2018

This method is now live in master. PyPI uploads are also now automated using CircleCI.

Is this good to close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants