ChrisRAoW / mautic-rss-to-email-bundle

Mautic plugin to send emails from RSS
103 stars 23 forks source link

Feature Request: Support for custom tags/namespaces #50

Open iPM-Maiwald opened 2 years ago

iPM-Maiwald commented 2 years ago

We use custom tags. To support a valid RSS-Feed, we have a custom prefix, which has its own namespace in the rss tag.

RSS-Feed <rss version="2.0" xmlns:prefix="namespaceURI">

We also changed the default case in the ItemTag.php like this.

default:
  $itemTag = null;

  if(strpos($this->tag, ':') !== false){
    $parts = explode(':', $this->tag);
    $prefix = $parts[0];
    $localName = $parts[1];
    $namespaceURI = 'www.ournamespace.com';
    //TODO lookup namespaceURI from $prefix
    $itemTag = $feedItem->get_item_tags($namespaceURI, $localName);
  }else{
    $itemTag = $feedItem->get_item_tags('', $this->tag);
  }

  if(!empty($itemTag)) {
    $value = $itemTag[0]['data'];
  }
break;

For looking up a namespace I suppose one needs to use something like that https://www.php.net/manual/en/xmlreader.lookupnamespace.php

Maybe you can implement a working solution?

Regards

Marcus

ChrisRAoW commented 2 years ago

@iPM-Maiwald Can you send over an example of your rss?

iPM-Maiwald commented 2 years ago

@ChrisRAoW can you mail me? m.maiwald@ipark-media.de

ChrisRAoW commented 2 years ago

@iPM-Maiwald I implemented a functionality to support custom fields. Could this work for you as well?

Check the ReadME file in the master branch

iPM-Maiwald commented 2 years ago

@ChrisRAoW Yes this would work. Do you have an ETA on the next release?

ChrisRAoW commented 2 years ago

@iPM-Maiwald It's already there. Version 1.6