# -*- Mode: Python; py-indent-offset: 4 -*-
# * Copyright (C) 2003 Legco <fafhrd@legco.biz> 

from Acquisition import Implicit
from DateTime import DateTime
from Products.Event.EventRegistry import eventRegistry

from ISMTPEvents import ISMTPEvent, ISMTPDiscoveryEvent

class SMTPEvent(Implicit):
    """ """
    __implements__ = ISMTPEvent
    __allow_access_to_unprotected_subobjects__ = 1

    def __init__(self, context, from_addr, to_addr, message, localpart, domain):
        self.context = context
        self.from_addr = from_addr
        self.to_addr = to_addr
        self.message = message
        self.localpart = localpart
        self.domain = domain

    def getId(self):
        """ returns the class name """
        return self.__class__.__name__


class SMTPDiscoveryEvent(SMTPEvent):
    """ Event generated when a content type is created """
    __implements__ = ISMTPDiscoveryEvent
