Skip to content

Interfaces

IContact

Bases: Interface

Hook into contact form.

Source code in ckanext/contact/interfaces.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class IContact(interfaces.Interface):
    """
    Hook into contact form.
    """

    def mail_alter(self, mail_dict, data_dict):
        """
        Allow altering of email values For example, allow directing contact form
        dependent on form values.

        :param data_dict: form values
        :param mail_dict: dictionary of mail values, used in mailer.mail_recipient
        :returns: altered mail_dict
        """
        return mail_dict

mail_alter(mail_dict, data_dict)

Allow altering of email values For example, allow directing contact form dependent on form values.

Parameters:

Name Type Description Default
data_dict

form values

required
mail_dict

dictionary of mail values, used in mailer.mail_recipient

required

Returns:

Type Description

altered mail_dict

Source code in ckanext/contact/interfaces.py
15
16
17
18
19
20
21
22
23
24
def mail_alter(self, mail_dict, data_dict):
    """
    Allow altering of email values For example, allow directing contact form
    dependent on form values.

    :param data_dict: form values
    :param mail_dict: dictionary of mail values, used in mailer.mail_recipient
    :returns: altered mail_dict
    """
    return mail_dict