@@ -79,12 +79,9 @@ If you click on the action select box you will get a list of actions that are al
As time goes by and more people start using and enhancing the [**Action Provider** extension][actionproviderrepo], the list will grow.
!!! Note "Create your own"
It is possible to develop your own specific actions, or indeed generic ones that others can use too! Check the relevant sections in this guide:
It is possible to develop your own specific actions, or indeed generic ones that others can use too! Check the relevant sections in [Example of Email Preferences](email-preferences.md)
* [Introduction to creating your own](create-your-own-introduction.md)
* [Example of Email Preferences](email-preferences.md)
In this example we have a first step: find the contact with the data from the form:
In this example we have a first step: find the contact with the data from the form.
@@ -146,14 +146,25 @@ public function getParameterSpecification() {
]);
}
```
The method *getConfigurationSpecification* determines what data I will output in my action.
The method *getConfigurationSpecification* is not really needed here because I have no configuration to set. But I do need this function in my class (as specified in the abstract class) so I make it 'void':
````php
/**
* @return SpecificationBag|void
*/
publicfunctiongetConfigurationSpecification(){
returnnewSpecificationBag();
}
````
The method *getOutputSpecification* determines what data I will output in my action.
In this case this will be the flags that correspond to my group memberships and the fields on my form processor:
```php
/**
* @return SpecificationBag
*/
publicfunctiongetConfigurationSpecification(){
publicfunctiongetOutputSpecification(){
returnnewSpecificationBag([
newSpecification('newsletter_and_action','Boolean',E::ts('Monthly Newsletter and Monthly Action'),FALSE),
@@ -161,6 +172,7 @@ public function getConfigurationSpecification() {
newSpecification('no_general_mail','Boolean',E::ts('No General Mails'),FALSE),
]);
}
```
The method *doAction* actually performs my action, so in this case use the contact_id to retrieve the group memberships and set my booleans reflecting this: