sebbmeyer / php-microsoft-teams-connector

PHP Microsoft Teams Connector
MIT License
109 stars 21 forks source link

Unsupported Card in "New Microsoft Teams" #27

Open on8pz opened 1 year ago

on8pz commented 1 year ago

Hello, It looks like including images in an CustomAdaptiveCard stopped working in the "New Microsoft Teams" version they are pushing to all Windows and Mac users currently.

Code example:

$connector = new \Sebbmyr\Teams\TeamsConnector(<TEAMS CONNECTOR URL>);

$textBlockA = new  \Sebbmyr\Teams\Cards\Adaptive\Elements\TextBlock("test");
$textBlockA->setColor( \Sebbmyr\Teams\Cards\Adaptive\Styles::COLORS_WARNING)
                    ->setSize( \Sebbmyr\Teams\Cards\Adaptive\Styles::FONT_SIZE_LARGE);

$image1 = new  \Sebbmyr\Teams\Cards\Adaptive\Elements\Image("https://bellard.org/bpg/2.png");
$image1->setSize( \Sebbmyr\Teams\Cards\Adaptive\Styles::IMAGE_SIZE_LARGE);

$card = new \Sebbmyr\Teams\Cards\Adaptive\CustomAdaptiveCard();
$card->addElement($textBlockA)->addElement($image1);
$connector->send($card);

The above code works in the old teams version (showing the png) but shows a broken image placeholder icon in the current "new teams version". If you right click the icon and select "Show immersive reader" you see the error message "Unsupported Card".

Unfortunately teams does not show any version numbers, so I cannot be more specific. The version that does not work has the radiobutton "New teams version" in the top left corner ticked. (Sigh, I miss the good old times when software had version numbers and no automatic updates...)

Any ideas on how to fix this?

on8pz commented 1 year ago

More info on the new teams launch schedule : https://petri.com/microsoft-teams-2-0-default-client-windows/ Microsoft is pushing this version to users as the default since a few weeks.

sebbmeyer commented 1 year ago

Thanks for pointing it out, I will take a look into it in the next couple of days. But a PR is always welcome, if anybody is already on it.