Skip to content

Commit

Permalink
Merge pull request #133 from plone/pf-renewal-cycle
Browse files Browse the repository at this point in the history
Pf renewal cycle
  • Loading branch information
ericof authored Sep 7, 2023
2 parents 147e6f0 + 0e519dc commit c907e9a
Show file tree
Hide file tree
Showing 14 changed files with 294 additions and 85 deletions.
4 changes: 2 additions & 2 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ create-site: instance/etc/zope.ini ## Create a new site from scratch

.PHONY: start
start: ## Start a Plone instance on localhost:8080
PYTHONWARNINGS=ignore ./bin/runwsgi instance/etc/zope.ini
ENABLE_PRINTING_MAILHOST=True PYTHONWARNINGS=ignore ./bin/runwsgi instance/etc/zope.ini

.PHONY: debug
debug: instance/etc/zope.ini ## Run debug console
Expand All @@ -178,4 +178,4 @@ create-tag: # Create a new tag using git
commit-and-release: # Commit new version change and create tag
@echo "Commiting changes"
@git commit -am "Tag release as $(PROJECT_VERSION) to deploy"
make create-tag
make create-tag
1 change: 1 addition & 0 deletions backend/src/ploneorg/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"plone.app.testing[robot]>=7.0.0a3",
"plone.restapi[test]",
"collective.MockMailHost",
"Products.PrintingMailHost",
"pytest",
],
},
Expand Down
1 change: 1 addition & 0 deletions backend/src/ploneorg/src/ploneorg/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
<include package=".serializers" />
<include package=".services" />
<include package=".subscribers" />
<include package=".interpolators" />

</configure>
Empty file.
20 changes: 20 additions & 0 deletions backend/src/ploneorg/src/ploneorg/interpolators/configure.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
>

<adapter
factory=".member.EmailSubstitution"
provides="plone.stringinterp.interfaces.IStringSubstitution"
for="ploneorg.content.member.IFoundationMember"
name="pf_member_email"
/>

<adapter
factory=".member.RenewURLSubstitution"
provides="plone.stringinterp.interfaces.IStringSubstitution"
for="ploneorg.content.member.IFoundationMember"
name="pf_renew_url"
/>

</configure>
26 changes: 26 additions & 0 deletions backend/src/ploneorg/src/ploneorg/interpolators/member.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from plone.stringinterp.adapters import BaseSubstitution
from ploneorg import _
from ploneorg.content.member import IFoundationMember
from zope.component import adapter


@adapter(IFoundationMember)
class EmailSubstitution(BaseSubstitution):
category = _("Foundation Member")
description = _("Member E-mail")

def safe_call(self):
name = self.context.title
email = self.context.email
if name and email:
return f"{name}<{email}>"


@adapter(IFoundationMember)
class RenewURLSubstitution(BaseSubstitution):
category = _("Foundation Member")
description = _("Renew URL")

def safe_call(self):
url = self.context.absolute_url()
return f"{url}?mtm_campaign=PFM&mtm_kwd=Renew"
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<contentrules>
<rule cascading="False"
description="Move a foundation member to renew state"
enabled="True"
event="Products.CMFCore.interfaces.IActionSucceededEvent"
name="rule-pf-renew"
stop-after="False"
title="Foundation Member Renew"
>
<conditions>
<condition type="plone.conditions.PortalType">
<property name="check_types">
<element>FoundationMember</element>
</property>
</condition>
<condition type="plone.conditions.WorkflowTransition">
<property name="wf_transitions">
<element>suspend</element>
</property>
</condition>
</conditions>
<actions>
<action type="plone.actions.Mail">
<property name="subject">Reminder: Time to Renew Your Plone Foundation Membership</property>
<property name="source">Plone Foundation&lt;[email protected]&gt;</property>
<property name="recipients">${pf_member_email}</property>
<property name="exclude_actor">True</property>
<property name="message">Dear ${title},

As we approach another exciting year for the Plone Foundation, it's time to renew your membership to maintain your active status and continue enjoying the benefits that come with it. As an active member, you have the privilege to:

1. Vote for the Plone Foundation Board of Directors
2. Participate in selecting the location for the next Plone Conference
3. Approve the minutes of the annual meeting
4. Exercise all other rights and privileges granted to Plone Foundation members

How to Renew Your Membership

1. Log in to your account at https://plone.org/login using your GitHub credentials.
2. Navigate to ${pf_renew_url} and click on the Renew Membership button.

If you no longer wish to maintain an active membership, you may choose to retire it by clicking on the Retire Membership button.

Need Assistance?

Should you encounter any issues or have questions regarding the renewal process, please don't hesitate to reach out to us at [email protected]. We are here to assist you.

We look forward to another year of collaboration and growth with you as part of the Plone Foundation.

Best regards,
Plone Foundation Board
[email protected]</property>
</action>
</actions>
</rule>
<assignment bubbles="True"
enabled="True"
location="/foundation/members"
name="rule-pf-renew"
/>
</contentrules>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<version>20230904001</version>
<version>20230907001</version>
<dependencies>
<dependency>profile-plone.volto:default</dependency>
<dependency>profile-plone.app.vulnerabilities:default</dependency>
Expand Down
10 changes: 10 additions & 0 deletions backend/src/ploneorg/src/ploneorg/upgrades/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,14 @@
/>
</genericsetup:upgradeSteps>

<genericsetup:upgradeSteps
profile="ploneorg:default"
source="20230904001"
destination="20230907001"
>
<genericsetup:upgradeDepends
title="Add a content rule to send a reminder to Foundation Members to renew their membership"
import_steps="contentrules"
/>
</genericsetup:upgradeSteps>
</configure>
2 changes: 1 addition & 1 deletion backend/src/ploneorg/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_latest_version(self):
"""Test latest version of default profile."""
self.assertEqual(
self.setup.getLastVersionForProfile("ploneorg:default")[0],
"20230904001",
"20230907001",
)


Expand Down
1 change: 1 addition & 0 deletions backend/src/ploneorg/tests/test_upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def available_steps(self, src, dst) -> list:
("20230412001", "20230528001", 1),
("20230528001", "20230530001", 1),
("20230530001", "20230904001", 1),
("20230904001", "20230907001", 1),
]
)
Expand Down
Loading

0 comments on commit c907e9a

Please sign in to comment.