def METHOD_NAME(self, method, pm):
    lines = list(TrustlyLog.objects.filter(error=True, sent=False, paymentmethod=method).order_by('timestamp'))
    if len(lines):
        sio = StringIO()
        sio.write("The following error events have been logged by the Trustly integration for {0}:\n\n".format(method.internaldescription))
        for line in lines:
            sio.write("%s: %s\n" % (line.timestamp, line.message))
            line.sent = True
            line.save()
        sio.write("\n\n\nAll these events have now been tagged as sent, and will no longer be\nprocessed by the system in any way.\n")
        send_simple_mail(settings.INVOICE_SENDER_EMAIL,
                         pm.config('notification_receiver'),
                         'Trustly integration error report',
                         sio.getvalue())