File size: 3,219 Bytes
9ece835
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Your RCS Cards</title>
    <style>

        body {

            font-family: Arial, sans-serif;

            line-height: 1.6;

            color: #333;

            max-width: 800px;

            margin: 0 auto;

            padding: 20px;

        }

        .card {

            border: 1px solid #ccc;

            border-radius: 8px;

            padding: 15px;

            margin-bottom: 20px;

            box-shadow: 0 2px 4px rgba(0,0,0,0.1);

        }

        .card img {

            max-width: 100%;

            height: auto;

            border-radius: 4px;

        }

        .card h3 {

            margin-top: 0;

            color: #0f0f0f;

        }

        .card p {

            margin: 10px 0;

        }

        .card a {

            display: inline-block;

            margin: 5px;

            padding: 8px 16px;

            background-color: #007bff;

            color: white;

            text-decoration: none;

            border-radius: 4px;

        }

        .quick-replies {

            margin-top: 10px;

        }

        .quick-replies button {

            margin: 5px;

            padding: 6px 12px;

            background-color: #f8f9fa;

            border: 1px solid #ccc;

            border-radius: 4px;

            cursor: pointer;

        }

        .quick-replies button:hover {

            background-color: #e9ecef;

        }

    </style>
</head>
<body>
    <h1>Your RCS Cards</h1>
    {% for card in rich_cards %}
        <div class="card">
            <h3>{{ card.title }}</h3>
            {% if card.media %}
                <img src="{{ card.media }}" alt="Card Media">
            {% endif %}
            <p>{{ card.text }}</p>
            <!-- {% if card.url %}

                <p><a href="{{ card.url }}">Visit Page</a></p>

            {% endif %} -->
            {% if card.buttons %}
                <div>
                    {% for button in card.buttons %}
                        {% if button.type == "weburl" %}
                            <a href="{{ button.payload }}">{{ button.title }}</a>
                        {% else %}
                            <a href="#" data-payload="{{ button.payload }}">{{ button.title }}</a>
                        {% endif %}
                    {% endfor %}
                </div>
            {% endif %}
            {% if card.quickReplies %}
                <div class="quick-replies">
                    {% for reply in card.quickReplies %}
                        {% if reply.type == "postback" %}
                            <button data-payload="{{ reply.payload }}" data-execute="{{ reply.execute|default('') }}">{{ reply.title }}</button>
                        {% elif reply.type == "call" %}
                            <button onclick="window.location.href='tel:{{ reply.payload }}'">{{ reply.title }}</button>
                        {% else %}
                            <button>{{ reply.title }}</button>
                        {% endif %}
                    {% endfor %}
                </div>
            {% endif %}
        </div>
    {% endfor %}
</body>
</html>