def main():
    html = """
    <h4>Dit is een titel</h4>
    <ul>
        <li>Bolleke 1</li>
        <li>Bolleke 2</li>
        <li>Bolleke 3</li>
    </ul>
    
    <img src="https://i.ebayimg.com/00/s/NTQ1WDcyOA==/z/TJUAAOSwYihc2YXa/$_86.JPG" alt="nen auto">
    """

    Email('*****@*****.**', '*****@*****.**',
          'testje met html', html)
Beispiel #2
0
    def register_post(self):
        e = bottle.request.POST.get('email')
        p1 = bottle.request.POST.get('password1')
        p2 = bottle.request.POST.get('password2')

        if e and p1 and p2:
            if p1 != p2:
                self.viewdata.update({
                    'error': 'The passwords do not match',
                    'email': e,
                    'password1': p1,
                    'password2': p2,
                })
                return self._template('register')
            else:
                u = User(_DBCON, email=e, password=p1)
                if u._id:
                    self.viewdata.update({
                        'error':
                        'An account already exists for that email address',
                        'email': e,
                        'password1': p1,
                        'password2': p2,
                    })

                    return self._template('register')
                else:
                    u.save()
                    e = Email(recipient=e)
                    e.send(
                        'Places accounts activation',
                        '<a href="%s/activate/%s">Activate</a>' %
                        (settings.BASEURL, u.token))

                    return bottle.redirect('/success')

        else:
            self.viewdata.update({
                'error': 'Please complete the form',
                'email': e,
                'password1': p1,
                'password2': p2,
            })

            return self._template('register')
Beispiel #3
0
def main():
    interests = [
        'Snapchat',
        'Zoom',
        'Covid-19',
        'SQL',
        'Apple',
        'Tesla',
        'TSLA',
        'Docker',
        'AWS',
    ]

    articles = get_relevant_articles(interests)
    html = construct_email(articles)

    Email(
        '*****@*****.**',
        '*****@*****.**',
        'Daily Digest %s' % get_current_day(),
        html
    )