timmoh/mailcoach-rssreader

A rss client for Mailcoach API from Spatie

3.0 2020-09-29 09:39 UTC

This package is auto-updated.

Last update: 2024-10-25 18:22:05 UTC


README

Latest Version on Packagist Test Status Code Style Status Total Downloads

RSS Feed Reader & Replacer for Spatie's awesome Mailcoach (https://mailcoach.app/) Fetch, parse and add automatically RSS Feed to your campaign

Version / Tagging

Tagging & Version goes along with mailcoach

  • Mailcoach v3 = Mailcoach RSS Reader (master/3.x)

Installation

You can install the package via composer:

composer require timmoh/mailcoach-rssreader

Publish Resources:

All Resources:

php artisan vendor:publish --tag=mailcoach-rss-reader-config

Usage

Add RssReplacer::class to config/mailcoach.php

'replacers' => [
    ...
     \Timmoh\MailcoachRssReader\Support\Replacers\RssReplacer::class,
    ...
],

XML-TEMPLATE

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
	<channel>
		<title>::RSSFEEDTITLE::</title>
		<link>::RSSFEEDURL::</link>
		<description>::RSSFEEDDESCRIPTION::</description>
		<item>
			<title>::RSSITEMTITLE::</title>
			<link>::RSSITEMURL::</link>
			<pubDate>::RSSITEMDATE::</pubDate>
			<author>::RSSITEMAUTHOR::</author>
			<category>::RSSITEMCATEGORIES::</category>
			<description>::RSSITEMDESCRIPTION::</description>
			<thumbnail>::RSSITEMTHUMBNAILURL::</thumbnail>
		</item>
	</channel>
</rss>

Example

Used XML:

<item>
    <title>My Rss item title</title>
    <description>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</description>
    <thumbnail>http://www.foo.bar/mythumb.jpg</thumbnail>
    <link>http://www.foo.bar/xyz.htm</link>
    <comments>http://www.foo.bar/forum</comments>
    <pubDate>Tue, 19 Oct 2004 11:09:11 -0400</pubDate>
    <creator>Mr Super</creator>
</item>

Replacer Code:

<div>
    ::RSSBLOCK|https://www.xyz.de/zxy.xml|::::RSSITEMSBLOCK|1::
    <span class="title"><a href="::RSSITEMURL::">::RSSITEMTITLE::</a></span>
    <span class="date">::RSSITEMDATE:|y-m-d h:i|::</span>
    <img src="::RSSITEMTHUMBNAILURL::">
    <span class="description">::RSSITEMDESCRIPTION::</span>
    ::RSSITEMSBLOCKEND::::RSSBLOCKEND::
</div>

Output:

<div>
    <span class="title"><a href="http://www.foo.bar/xyz.htm">My Rss item title</a></span>
    <span class="date">2004-10-19 11:09</span>
    <img src="http://www.foo.bar/mythumb.jpg">
    <span class="content">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</span>
</div>

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email timo@doersching.net instead of using the issue tracker.

Credits

This package was inspired by the Laravel Feed Reader by Vedmant.

License

The MIT License (MIT). Please see License File for more information.