collective.contentrules.mailfromfield


Namecollective.contentrules.mailfromfield JSON
Version 1.2.1 PyPI version JSON
download
home_page
SummaryA Plone content rule for send e-mail to addresses taken from the content
upload_time2023-06-20 07:31:19
maintainer
docs_urlNone
authorRedTurtle Technology
requires_python>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*
licenseGPL
keywords plone rules mail plonegov
VCS
bugtrack_url
requirements setuptools zc.buildout
Travis-CI No Travis.
coveralls test coverage
            
.. image:: https://img.shields.io/pypi/v/collective.contentrules.mailfromfield.svg
    :target: https://pypi.org/project/collective.contentrules.mailfromfield/
    :alt: Latest Version

.. image:: https://img.shields.io/pypi/pyversions/collective.contentrules.mailfromfield.svg?style=plastic
    :target: https://pypi.org/project/collective.contentrules.mailfromfield/
    :alt: Supported - Python Versions

.. image:: https://img.shields.io/pypi/dm/collective.contentrules.mailfromfield.svg
    :target: https://pypi.org/project/collective.contentrules.mailfromfield/
    :alt: Number of PyPI downloads

.. image:: https://img.shields.io/pypi/l/collective.contentrules.mailfromfield.svg
    :target: https://pypi.org/project/collective.contentrules.mailfromfield/
    :alt: License

.. image:: https://github.com/RedTurtle/collective.contentrules.mailfromfield/actions/workflows/tests.yml/badge.svg
    :target: https://github.com/RedTurtle/collective.contentrules.mailfromfield/actions
    :alt: Tests
    
.. image:: https://coveralls.io/repos/github/RedTurtle/collective.contentrules.mailfromfield/badge.svg?branch=master
    :target: https://coveralls.io/github/RedTurtle/collective.contentrules.mailfromfield?branch=master
    :alt: Coverage

.. contents::

Introduction
============

This product will add to Plone a new content rules, someway similar to the default "*Send an email*" ones.
The difference is that the email recipient is taken dinamically from a site content, not from a
static list of values.

In this way the same rule, applied in different places in the site, can send the message to different users.

How to use
==========

The rules can be enabled globally and locally like every one else, as default Plone feature.
In the rule configuration panel you need to fill a set of information:

``Subject``
    The e-mail subject. You can place inside this text some markers (see below).
``Sender email``
    The sender of the e-mail. You can leave this empty and automatically use the one from the
    general mail settings.
``Source field``
    You must put there the name of the attribute from which you want to retrieve the recipient
    e-mail. See next section.
``Target element``
    You need to select if the recipient's e-mail must be taken from:

    * the container where the rules is activated on
    * the content who notified the event that started the rule execution
    * the parent of that content

    See below for details.
``Mail message``
    The body text of the e-mail that will be sent. The text is the same for all section where
    the rule is activated on.

    You can place inside this text some markers (see below).

How it take the email data
--------------------------

First of all you must choose the *Target element*.

If you choose to keep default "*From rule's container*" option address will be read from the section you have
activated the rule on.

*Example*: if you activated the rule on folder ``/site/section`` and the rule will raise event when
working on a document ``/site/section/folder/foo`` the email address will be taken
from the folder.

Changing to "*From content that triggered the event*" will change the behavior, trying to get email data
from the content that raised the event.

*Example*: if you activated the rule on a folder ``/site/section`` and the rule  will raise event when
working on a document ``/site/section/folder/foo`` the email address will be taken
from the ``foo`` document.

Finally, if you choose "*From content's parent*", adresses will the taken from the container of the content
that triggered the event.

*Example*: if you activated the rule on a folder ``/site/section`` and the rule  will raise event when
working on a document ``/site/section/folder/foo`` the email address will be taken
from ``folder``.

What it try to read
-------------------

The rule try to get from the object:

* an attribute of the given name
* a callable method from the given name
* an Archetypes field with given id
* a ZMI property with given id

The rule try to read, one after one, all this data. The first match found will be the one used;
if not one give results, no e-mail is sent at all.

Message interpolation
---------------------

Marker labels that follow can be used in the message text and subject.

``${title}``
    The title of the content that triggered the event (``foo`` title in our example)
``${url}``
    The URL of the content that triggered the event (``foo`` URL in our example)
``${section_name}``
    The title of the folder where the rule is activated on (``section`` title in our example)
``${section_url}``
    The URL of the folder where the rule is activated on (``section`` URL in our example)

A real Plone use case
---------------------

A Plone site use `Signup Sheet`__ for manage internal training session. The form fieldset is
customized as normal, but one of the field is ``director_email``.

__ http://plone.org/products/signupsheet

We want that this e-mail address is notified when a user subscribe and the user
itself put there the e-mail address of the proper director.

To reach this we need to:

* create a new rule triggered on "*Object added to this container*"
* add a filter condition based on content type *Registrant*
* add an action using the "*Send email to address taken from the content*"
* specify in the action the SignupSheet field with the director email
* specify in the action that we want to take the email from the target content
  (the Registrant itself)

TODO
====

* why don't support also looking in annotations?
* right now the rules check all mail source until one is found with a defined order;
  maybe is better to leave this choice to the configuration
* Dexterity support (probably already there, but needs to be tested)

Requirements
============

This product has been tested on:

* Plone 4.2 with 0.4 version
* Plone 4.3 with 0.4 version
* Plone 5.0
* Plone 5.1

Credits
=======

Developed with the support of `S. Anna Hospital, Ferrara`__; S. Anna Hospital supports the
`PloneGov initiative`__.

.. image:: http://www.ospfe.it/ospfe-logo.jpg
   :alt: OspFE logo

__ http://www.ospfe.it/
__ http://www.plonegov.it/

This product was largely developed looking at the source of `collective.contentrules.mailtogroup`__.

__ http://plone.org/products/collective.contentrules.mailtogroup

Authors
=======

This product was developed by RedTurtle Technology team.

.. image:: http://www.redturtle.it/redturtle_banner.png
   :alt: RedTurtle Technology Site
   :target: http://www.redturtle.it/


Changelog
=========

1.2.1 (2023-06-20)
------------------

- send email on successful transaction commit (#9)
  [mamico]


1.2.0 (2023-06-19)
------------------

- Change mail send method and allow to eventually add attachments.
  [cekk]

1.1.0 (2023-06-19)
------------------

- Plone 6 support
  [foxtrot-dfm1]

1.0.1 (2021-03-10)
------------------

- Allow to get to the end of the action execution if no mail is provided.
  You don't want the page to break if the email is missing. 
  For the anonymous user this wold be a bad UX
  [lucabel]


1.0.0 (2020-11-23)
------------------

- Migrate code to Plone 5/python 3.
  [lucabel]
- Add support for plone.stringinterp.
  [cekk]

0.4.0 (2015-03-13)
------------------

Dropped Plone 3 compatibility

- Fixed some label that were not i18n compatible
  [keul]
- Fixed wrong documentation mess introduced on version 0.3:
  the new "parent" option was wrongly descripted
  [keul]
- Updated documentation to reflect changes done in version 0.3
  [keul]

0.3.0 (2014-05-06)
------------------

- Fix unicode error while replacing strings [nicolasenno]
- Do not fail if a rule is activated on a non-AT content [keul]
- Do not try to send mail to empty string recipients [keul]
- Refactoring [alert]
- Added parent option in the target vocabulary [alert]

0.2.0 (2013-05-02)
------------------

* lowered logging level to debug
  [keul]
* fixed ruleAction factory
  [cekk]

0.1.0 (2011-10-21)
------------------

* Initial release

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "collective.contentrules.mailfromfield",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*",
    "maintainer_email": "",
    "keywords": "plone rules mail plonegov",
    "author": "RedTurtle Technology",
    "author_email": "sviluppoplone@redturtle.it",
    "download_url": "https://files.pythonhosted.org/packages/97/4a/d0c792282281eceebfdf017562764fcd924399e12c386861ca0dd85afe41/collective.contentrules.mailfromfield-1.2.1.tar.gz",
    "platform": null,
    "description": "\n.. image:: https://img.shields.io/pypi/v/collective.contentrules.mailfromfield.svg\n    :target: https://pypi.org/project/collective.contentrules.mailfromfield/\n    :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/pyversions/collective.contentrules.mailfromfield.svg?style=plastic\n    :target: https://pypi.org/project/collective.contentrules.mailfromfield/\n    :alt: Supported - Python Versions\n\n.. image:: https://img.shields.io/pypi/dm/collective.contentrules.mailfromfield.svg\n    :target: https://pypi.org/project/collective.contentrules.mailfromfield/\n    :alt: Number of PyPI downloads\n\n.. image:: https://img.shields.io/pypi/l/collective.contentrules.mailfromfield.svg\n    :target: https://pypi.org/project/collective.contentrules.mailfromfield/\n    :alt: License\n\n.. image:: https://github.com/RedTurtle/collective.contentrules.mailfromfield/actions/workflows/tests.yml/badge.svg\n    :target: https://github.com/RedTurtle/collective.contentrules.mailfromfield/actions\n    :alt: Tests\n    \n.. image:: https://coveralls.io/repos/github/RedTurtle/collective.contentrules.mailfromfield/badge.svg?branch=master\n    :target: https://coveralls.io/github/RedTurtle/collective.contentrules.mailfromfield?branch=master\n    :alt: Coverage\n\n.. contents::\n\nIntroduction\n============\n\nThis product will add to Plone a new content rules, someway similar to the default \"*Send an email*\" ones.\nThe difference is that the email recipient is taken dinamically from a site content, not from a\nstatic list of values.\n\nIn this way the same rule, applied in different places in the site, can send the message to different users.\n\nHow to use\n==========\n\nThe rules can be enabled globally and locally like every one else, as default Plone feature.\nIn the rule configuration panel you need to fill a set of information:\n\n``Subject``\n    The e-mail subject. You can place inside this text some markers (see below).\n``Sender email``\n    The sender of the e-mail. You can leave this empty and automatically use the one from the\n    general mail settings.\n``Source field``\n    You must put there the name of the attribute from which you want to retrieve the recipient\n    e-mail. See next section.\n``Target element``\n    You need to select if the recipient's e-mail must be taken from:\n\n    * the container where the rules is activated on\n    * the content who notified the event that started the rule execution\n    * the parent of that content\n\n    See below for details.\n``Mail message``\n    The body text of the e-mail that will be sent. The text is the same for all section where\n    the rule is activated on.\n\n    You can place inside this text some markers (see below).\n\nHow it take the email data\n--------------------------\n\nFirst of all you must choose the *Target element*.\n\nIf you choose to keep default \"*From rule's container*\" option address will be read from the section you have\nactivated the rule on.\n\n*Example*: if you activated the rule on folder ``/site/section`` and the rule will raise event when\nworking on a document ``/site/section/folder/foo`` the email address will be taken\nfrom the folder.\n\nChanging to \"*From content that triggered the event*\" will change the behavior, trying to get email data\nfrom the content that raised the event.\n\n*Example*: if you activated the rule on a folder ``/site/section`` and the rule  will raise event when\nworking on a document ``/site/section/folder/foo`` the email address will be taken\nfrom the ``foo`` document.\n\nFinally, if you choose \"*From content's parent*\", adresses will the taken from the container of the content\nthat triggered the event.\n\n*Example*: if you activated the rule on a folder ``/site/section`` and the rule  will raise event when\nworking on a document ``/site/section/folder/foo`` the email address will be taken\nfrom ``folder``.\n\nWhat it try to read\n-------------------\n\nThe rule try to get from the object:\n\n* an attribute of the given name\n* a callable method from the given name\n* an Archetypes field with given id\n* a ZMI property with given id\n\nThe rule try to read, one after one, all this data. The first match found will be the one used;\nif not one give results, no e-mail is sent at all.\n\nMessage interpolation\n---------------------\n\nMarker labels that follow can be used in the message text and subject.\n\n``${title}``\n    The title of the content that triggered the event (``foo`` title in our example)\n``${url}``\n    The URL of the content that triggered the event (``foo`` URL in our example)\n``${section_name}``\n    The title of the folder where the rule is activated on (``section`` title in our example)\n``${section_url}``\n    The URL of the folder where the rule is activated on (``section`` URL in our example)\n\nA real Plone use case\n---------------------\n\nA Plone site use `Signup Sheet`__ for manage internal training session. The form fieldset is\ncustomized as normal, but one of the field is ``director_email``.\n\n__ http://plone.org/products/signupsheet\n\nWe want that this e-mail address is notified when a user subscribe and the user\nitself put there the e-mail address of the proper director.\n\nTo reach this we need to:\n\n* create a new rule triggered on \"*Object added to this container*\"\n* add a filter condition based on content type *Registrant*\n* add an action using the \"*Send email to address taken from the content*\"\n* specify in the action the SignupSheet field with the director email\n* specify in the action that we want to take the email from the target content\n  (the Registrant itself)\n\nTODO\n====\n\n* why don't support also looking in annotations?\n* right now the rules check all mail source until one is found with a defined order;\n  maybe is better to leave this choice to the configuration\n* Dexterity support (probably already there, but needs to be tested)\n\nRequirements\n============\n\nThis product has been tested on:\n\n* Plone 4.2 with 0.4 version\n* Plone 4.3 with 0.4 version\n* Plone 5.0\n* Plone 5.1\n\nCredits\n=======\n\nDeveloped with the support of `S. Anna Hospital, Ferrara`__; S. Anna Hospital supports the\n`PloneGov initiative`__.\n\n.. image:: http://www.ospfe.it/ospfe-logo.jpg\n   :alt: OspFE logo\n\n__ http://www.ospfe.it/\n__ http://www.plonegov.it/\n\nThis product was largely developed looking at the source of `collective.contentrules.mailtogroup`__.\n\n__ http://plone.org/products/collective.contentrules.mailtogroup\n\nAuthors\n=======\n\nThis product was developed by RedTurtle Technology team.\n\n.. image:: http://www.redturtle.it/redturtle_banner.png\n   :alt: RedTurtle Technology Site\n   :target: http://www.redturtle.it/\n\n\nChangelog\n=========\n\n1.2.1 (2023-06-20)\n------------------\n\n- send email on successful transaction commit (#9)\n  [mamico]\n\n\n1.2.0 (2023-06-19)\n------------------\n\n- Change mail send method and allow to eventually add attachments.\n  [cekk]\n\n1.1.0 (2023-06-19)\n------------------\n\n- Plone 6 support\n  [foxtrot-dfm1]\n\n1.0.1 (2021-03-10)\n------------------\n\n- Allow to get to the end of the action execution if no mail is provided.\n  You don't want the page to break if the email is missing. \n  For the anonymous user this wold be a bad UX\n  [lucabel]\n\n\n1.0.0 (2020-11-23)\n------------------\n\n- Migrate code to Plone 5/python 3.\n  [lucabel]\n- Add support for plone.stringinterp.\n  [cekk]\n\n0.4.0 (2015-03-13)\n------------------\n\nDropped Plone 3 compatibility\n\n- Fixed some label that were not i18n compatible\n  [keul]\n- Fixed wrong documentation mess introduced on version 0.3:\n  the new \"parent\" option was wrongly descripted\n  [keul]\n- Updated documentation to reflect changes done in version 0.3\n  [keul]\n\n0.3.0 (2014-05-06)\n------------------\n\n- Fix unicode error while replacing strings [nicolasenno]\n- Do not fail if a rule is activated on a non-AT content [keul]\n- Do not try to send mail to empty string recipients [keul]\n- Refactoring [alert]\n- Added parent option in the target vocabulary [alert]\n\n0.2.0 (2013-05-02)\n------------------\n\n* lowered logging level to debug\n  [keul]\n* fixed ruleAction factory\n  [cekk]\n\n0.1.0 (2011-10-21)\n------------------\n\n* Initial release\n",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "A Plone content rule for send e-mail to addresses taken from the content",
    "version": "1.2.1",
    "project_urls": {
        "PyPI": "https://pypi.python.org/pypi/collective.contentrules.mailfromfield",
        "Source": "https://github.com/RedTurtle/collective.contentrules.mailfromfield",
        "Tracker": "https://github.com/RedTurtle/collective.contentrules.mailfromfield/issues"
    },
    "split_keywords": [
        "plone",
        "rules",
        "mail",
        "plonegov"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ee193addf3e7fe7a6079d64e3f4bd0c2fbac48b4aba1344f2e9904416604eadb",
                "md5": "3959af1056aab3791adda3d2049523c7",
                "sha256": "b862e4bf6f6b715a4fb5c414265e15a6ab5028d999f03931e5c969403986a3b3"
            },
            "downloads": -1,
            "filename": "collective.contentrules.mailfromfield-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3959af1056aab3791adda3d2049523c7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*",
            "size": 19771,
            "upload_time": "2023-06-20T07:31:17",
            "upload_time_iso_8601": "2023-06-20T07:31:17.448480Z",
            "url": "https://files.pythonhosted.org/packages/ee/19/3addf3e7fe7a6079d64e3f4bd0c2fbac48b4aba1344f2e9904416604eadb/collective.contentrules.mailfromfield-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "974ad0c792282281eceebfdf017562764fcd924399e12c386861ca0dd85afe41",
                "md5": "9643501779e42d7beb9467cf61741946",
                "sha256": "97485f83342927946c333d8119c52784f28cec6bf9e47e789825095ecf29253d"
            },
            "downloads": -1,
            "filename": "collective.contentrules.mailfromfield-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9643501779e42d7beb9467cf61741946",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*",
            "size": 24372,
            "upload_time": "2023-06-20T07:31:19",
            "upload_time_iso_8601": "2023-06-20T07:31:19.594690Z",
            "url": "https://files.pythonhosted.org/packages/97/4a/d0c792282281eceebfdf017562764fcd924399e12c386861ca0dd85afe41/collective.contentrules.mailfromfield-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-20 07:31:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RedTurtle",
    "github_project": "collective.contentrules.mailfromfield",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "setuptools",
            "specs": []
        },
        {
            "name": "zc.buildout",
            "specs": []
        }
    ],
    "tox": true,
    "lcname": "collective.contentrules.mailfromfield"
}
        
Elapsed time: 0.08117s