responsiv / campaign-plugin

[PREMIUM] Send professional campaign messages to your subscribers.
http://octobercms.com/plugin/responsiv-campaign
5 stars 2 forks source link

Question about repeating campaign with dynamic content #32

Closed boowee closed 2 years ago

boowee commented 7 years ago

Content in duplicate messages are not updated. For example: if I need send daily blog updates. I add BlogPosts component on page & create daily repeating campaing. First message will contain latest posts. On next day I create new post but content of second message will be same as first.

daftspunk commented 7 years ago

Just want to make sure, you have also created new blog posts on the second day?

boowee commented 7 years ago

Yes, I have new posts. Looks like a bug. I would like to ask about logic of repeating campaign. The message is created "today for tomorrow". For example. Each Sunday I need to send a weekly newsletter with posts in a week. The new message which will be send on next week, will be created at the time of sending the current message and the content of the new message will be created based on the current blog posts. But this is not what I need, because this is the message for the previous week. I hope you understood my problem. Thanks a lot.

daftspunk commented 7 years ago

Can you provide the template file contents you are using for this? So we can try to replicate it. Thanks

boowee commented 7 years ago
title = "Daily blog"
url = "/campaign/message/:code"
description = "Campaign with basic fields"
is_hidden = 0

[campaignTemplate]

[blogPosts]
pageNumber = "{{ :page }}"
postsPerPage = 5
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = "blog/category"
postPage = "blog/post"
==
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Newsletter</title>
    <style>
        ul{
            list-style: none;
        }
        p{
            font-size: 12px;
        }
        a{
            color: #f65d34;
            font-size: 13px;
        }
    </style>
</head>

<body style="padding:0px;margin:0px;background-color:#e0e0e0;">

    <table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="font-family: Helvetica, sans-serif;">
    <tr>
    <td bgcolor="#e0e0e0">

        <table cellspacing="0" cellpadding="0" border="0" align="center" style="padding: 20px 0;">
            <tr>
                <td width="700" bgcolor="#ffffff" >

                    {% set posts = blogPosts.posts %}

                    <ul class="post-list">
                        {% for post in posts %}
                            <li>
                                <p><a href="{{ post.url }}">{{ post.title }}</a></p>
                                <p class="info">
                                    Posted on {{ post.published_at|date('M d, Y') }}
                                </p>
                                <p class="excerpt">{{ post.summary }}</p>
                                <br/>
                            </li>
                        {% else %}
                            <li class="no-data">{{ noPostsMessage }}</li>
                        {% endfor %}
                    </ul>

                </td>
                </tr>
        </table>

    </td>
    </tr>
    </table>

</body>
</html>

Campaign properties campaign

daftspunk commented 2 years ago

Fixed this bug and also dynamic template support is added in v2.0.1